serialize() problem
Posted: Fri Feb 19, 2010 5:17 am
Hi,
I am trying to insert an array into a mySQL database using the serialize function. When I echo the function onto the page it works and I get this:
However, when I insert this exact same variable into my dabase, it becomes null and I get this:
I am using wordpress and this is my code:
All help is greatly appreciated.
Thanks
I am trying to insert an array into a mySQL database using the serialize function. When I echo the function onto the page it works and I get this:
Code: Select all
a:1:{i:0;s:3:"111";}Code: Select all
a:1:{i:0;N;}Code: Select all
$serialized_xer = serialize($album_array);
echo $serialized_xer;
$wpdb->query("UPDATE $wpdb->nggalbum SET sortorder = '$serialized_xer' WHERE id = '$album_id' ");Thanks