title: How to insert a string that contains quote marks into a database?
body: <p>When I try to instert a string that contains a quote mark, the INSERT query fails. How can I insert strings with single or double quotes?</p>
  
  <p>for example:</p>
  
  <pre><code>$message = "Bob said 'don't forget to call me'";
  
  mysql_query("INSERT INTO someTable (messages) VALUES ('$message')");
  </code></pre>
  
  <p>I figure the input needs to be filtered but which function should I use for that?</p>