Jump to content

cant execute a query with serialized data


gdfhghjdfghgfhf

Recommended Posts

i'm tyring to do an UPDATE on a field and i want to put a serialized string.... so it includes double quotes and others weird symbols.... so it's breaking my sql query

 

how can i solve this? i need to preserve the syntax of my serialized string with the double quotes intact or else it wont work right

here is the code:


$a = $row["options"];

$ary = unserialize($a);
$ary[] = $title;
$b = serialize($ary);


$zxc = "UPDATE quebec_calendarcustomfield SET options = '$b' WHERE calendarcustomfieldid = '1'";

 

 

so the sql query will look like this

UPDATE quebec_calendarcustomfield SET options = 'a:4:{i:1;s:7:"option1";i:2;s:7:"option2";i:3;s:7:"option3";i:4;s:3:"etc";}' WHERE calendarcustomfieldid = '1'

 

see?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.