Heys,
I have this script:
$sql = "UPDATE tbl_pistols_image
SET im_album_id = $albumId,
im_title = '$imgTitle',
im_description = '$imgDesc',
im_image = $image,
im_thumbnail = $thumbnail,
im_date = NOW()
WHERE im_id = $imgId";
Ok, so we are updating a row here.
However if the user enters any inverted commas into the text field that are being updated, I receive this error:
Error, update image failed : 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 'Peniet Pistol'', im_image = im_image, im_thumbnail
Using quotes works fine and inserts them fine, it just seems to be any inverted commas, and I guess they are altering the SQL syntax when executed.
Anyone know any fixes for this problem to allow users to submit inverted commas as part of the text?
Thanks in adv.
Chris.