Shibby-Shabs
09-11-2010, 10:35 AM
Ok so I've got a simple page editor:
$update = mysql_query("UPDATE pages SET body='$_POST[content]' WHERE id='$_GET[id]'") or die(mysql_error());
die("<b>The page has successfully been updated!</b>");
but if I in the text area where you edit I put a " or ' it gives me an error that says this:
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 'll' WHERE id='1'' at line 1
Obviously it's the ' in the mysql query but how do I prevent?
BTW: it has ll 'cos for the example I wrote ya'll
$update = mysql_query("UPDATE pages SET body='$_POST[content]' WHERE id='$_GET[id]'") or die(mysql_error());
die("<b>The page has successfully been updated!</b>");
but if I in the text area where you edit I put a " or ' it gives me an error that says this:
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 'll' WHERE id='1'' at line 1
Obviously it's the ' in the mysql query but how do I prevent?
BTW: it has ll 'cos for the example I wrote ya'll