I collect data from the form and throw it into the database. Some of the data just needs to be serialized. But here a trouble, mysql throws an error ... I can not understand that it does not like in the serialized data
$prop = serialize($elements['prop']); $prop = addslashes($prop); $sql = 'insert into iblocks(name,code,desct,serialize) values('.$elements['name'].','.$elements['code'].','.$elements['desc'].','.$prop.')';
Mistake:
corresponds to your MySQL server version for the right syntax to use near ':2:{i:0;a:5:{s:4:\"name\";s:3:\"sdf\";s:4:\"code\";s:3:\"sfd\";s:4:\"type\";s:3:' at line 1