When I try to execute a line containing a quotation mark, the INSERT request fails. How to insert strings with single or double quotes?
eg:
$message = "Bob said 'don't forget to call me'";
mysql_query("INSERT INTO someTable (messages) VALUES ('$message')");
I suppose the input should be filtered out, but what function should I use for this?
source
share