Hi..
I am really bashing my head on this one. I have an image I have manipulated, now I want to push it back to the database.
So, to accomplish this, I have the following:
--- $image_file = fopen ('/var/tmp/tmp.jpg','rb');
$image_data = fread ($image_file, filesize ('/var/tmp/tmp.jpg'));
$image_data = addslashes ($image_data);
fclose ($image_file);
$sql = "UPDATE article_attachment SET content = $image_data where id = $article_data[0]";
$image_update = mysql_query ($sql);
echo mysql_error($dbi);
---
It's more drawn out than it should be, but I am breaking everything down to try and solve this. I get the 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 '▒▒▒▒\0JFIF\0\0\0\0\0\0▒▒\0>CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), defa' at line 11"
I see some high order characters that don't appear to be getting escaped properly, should this be happening?...
Thanks,
Richard.