Re: Problem serializing a mysqli_result object.
| From: | Bjarke Freund-Hansen | Date: | Fri, 08 Jul 2005 05:31:47 +0000 |
| Subject: | Re: Problem serializing a mysqli_result object. | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-218334@lists.php.net to get a copy of this message | ||
Richard Lynch wrote:
>On Thu, July 7, 2005 12:53 pm, Bjarke Freund-Hansen said:
>
>
>>>You can't serialize resource objects. Try:
>>>
>>>serialize($res->fetch_assoc());
>>>
>>>
>>I know I can serialize the array fetch_assoc returns, but I really need to
>>serialize a mysqli_result, so I can feed it to any function expecting a
>>mysqli_result.
>>
>>
>
>The connection simply WILL NOT survive the ending of a PHP script.
>
>Period.
>
>
But I'm not trying to keep the connection, I don't care about the
connection. What I want to serialize is the object returned from
mysqli->query().
>If you want to hack the PHP source to try to change that, go for it...
>
>
I've gone so far as to rewrite the mysqli_result class (in PHP), and
parse the object returned from mysqli->query() to my own class, and
serialize that one. Which I guess will work. But is that really the
easiest way?
--
Bjarke Freund-Hansen <bjarke@rocekiller.dk>