|
Posted by Bjarke Freund-Hansen on 07/07/05 22:23
Hi.
I'm having a problem serializing a mysqli_result object, the serialized
string contains only an empty object.
The code is as following:
$sql = new Mysqli("localhost", "user", "pass", "database");
$res = $sql->query("SELECT * FROM xxx WHERE `id` = 1");
print_r($res->fetch_assoc());
echo "\n" . serialize($res);
Which outputs:
Array
(
[id] => 1
[dbname] => xyzxyzxyz
[firstname] => xyz
[lastname] => zyx
[company] => N/A
[address] => xyz
[zip] => 8500
[city] => Xyz
[country] => ZZyyxx
[language] => 1
[comments] => zyx_
_)
O:13:"mysqli_result":0:{}
As you can see, the serialized string doesn't contain any of the data.
And surely enough the unserialized object doesn't contain anything. I'm
using PHP 5.0.3
I've been googleing for a couple of hours now, and I can't find anything
about serializing a mysqli_result object.
What is going on? How can I do this? Can I do it another way? Or am I
just doing something wrong?
Thanks
--
Bjarke Freund-Hansen <bjarke@rocekiller.dk>
Navigation:
[Reply to this message]
|