learning_brain
New Member
- Messages
- 206
- Reaction score
- 1
- Points
- 0
I can't get my head round this....
I have an array which I want to store to the DB (I won't even go into the reasons for this!) but am having problems.
The serialized array string contains double quotes, so I have to be careful.
I have tried without the sprintf method as well.
I'm getting back an error.
I tried the following structure too...
But I get back
I can't wrap the serialized array in double or single quotes here without causing problems.
Any ideas?
I have an array which I want to store to the DB (I won't even go into the reasons for this!) but am having problems.
The serialized array string contains double quotes, so I have to be careful.
PHP:
$query_insert_summary = sprintf('INSERT INTO IMGCOMPS (DESCRIPTION, ANALYSIS) VALUES ("Test","%s")',$serialisedSummaryArray);
$result_insert_summary = mysql_query($query_insert_summary, $discountdomains) or die(mysql_error());
I have tried without the sprintf method as well.
I'm getting back an error.
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Highlights";i:0;s:9:"Lowlights";i:0;s:5:"Greys";d:49;s:5:"Flesh";d:7.00000000000' at line 1
I tried the following structure too...
PHP:
$query_insert_summary = 'INSERT INTO IMGCOMPS (DESCRIPTION, ANALYSIS) VALUES ("Test",$serialisedSummaryArray)';
But I get back
Unknown column '$serialisedSummaryArray' in 'field list'
I can't wrap the serialized array in double or single quotes here without causing problems.
Any ideas?