note 53198 deleted from language.oop.serialization by danbrown
| From: | danbrown@php.net | Date: | Sat, 07 Nov 2009 19:12:53 +0000 |
| Subject: | note 53198 deleted from language.oop.serialization by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-162603@lists.php.net to get a copy of this message | ||
Note Submitter: nate at NO-SPAMnatereed dot com
----
I can't store an instance of MySQLPagedResultSet (I grabbed this code from Kevin Yank at
Sitepoint) in my session without losing all the data. This seems related to the previous post since
the result set member variable is from calling mysql_query(). It doesn't get serialized
properly and when I retrieve it from the session the result set is empty.
My workaround is store the query (ie. select * from mydata where id in (1,2,3...)) instead of the
result set. In this particular case, it works beautifully and yields a big performance boost, since
the id's are generated from several other queries that can now be avoided. With query caching
on in mysql, I would not be surprised if this is just as fast or faster than retrieving the result
set from the session. There are fewer potential data synchronization problems, too, since the info
from mydata is fresh.