The joys of serializing data
To serialize a variable or object in PHP means to take the variable or object and convert it to a string that can be stored anywhere, including, relevant to vB, a MySQL database. Later, it can be unserialized, at which point it'll be (nearly) exactly the same as when it was serialized.
An example: PHP Code:
Reference: http://www.php.net/serialize http://www.php.net/unserialize (way faster than serializing) |
Note that you can't serialize resources (such as a mysql connection) so the example posted won't work.
|
The example itself should work, though, because $DB_site is just an object that never stores a result handle (at least not permanently).
|
Quote:
$query_id can't be serialized either. In order to run $DB_site->query(), $link_id has to be a valid MySQL connection resource. |
Oh, good point ;)
But the concept is there ;) |
Great! A thread on serializing. ;)
I'm just starting to learn this. Maybe you can answer this question, filburt. How do we determine this when making the query for the datstore? PHP Code:
|
s(tring):(Length)1:(Value)"0";s(tring):(Length)14:(Value)"getthreadviews";
I'd guess. |
Why would you need 2 string lengths in there? ;)
|
PHP Code:
|
Ahhh, ok, now I understand. ;)
Thank you, sir. ;) |
All times are GMT. The time now is 04:32 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|