Forum Moderators: coopster
$message = $_REQUEST['message'];
I get the message via an HTML form. The MYSQL query inputs the $message into my database table. It works fine, but when I make a message using the " ' " character, I get a syntax error.
yes addslashes is one option but there are functions made specifically for escaping data to be inserted into mysql. You should use this one
mysql_real_escape_string() [php.net]
Another thing we should cover is not using $_REQUEST. I am guessing that the message var is posted to the script therefore you should use $_POST instead. There are security issues with using $_REQUEST.