Problem serializing a mysqli_result object.

From: Date: Thu, 07 Jul 2005 19:23:40 +0000
Subject: Problem serializing a mysqli_result object.
Groups: php.general 
Request: Send a blank email to php-general+get-218311@lists.php.net to get a copy of this message
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>

« previous php.general (#218311) next »