PDA

View Full Version : Retrieve


rogersnm
05-21-2006, 05:07 PM
When i query:
SELECT `data` FROM `datastore` WHERE `title` IN ('maxloggedin')

i end up with:
a:y:{s:y:"maxonline";i:X;s:y:"maxonlinedate";i:y;}

where as i only want:
a:y:{s:y:"maxonline";i:X;s:y:"maxonlinedate";i:y;}

so how do i trim off:
a:y:{s:y:"maxonline";i:X;s:y:"maxonlinedate";i:y;}
to end up with just the X bearing in mind the the prefix and sufix will change... so it needs to still be able to work with that....


Regards,
Nick.

(i am a complete idiot at this at this, so can you just give me the sql query instead of explaining it because i won't get it....)





Anyone?

filburt1
05-21-2006, 07:33 PM
Don't parse it. Use http://www.php.net/unserialize .