title: Does this PHP function protect against SQL injection?
body: <p>I have this function I'm using and I want to be sure that it fully protects against SQL injection attacks:</p>
  
  <pre><code>function MakeSafeForQuery($string)
  {
      // replace all of the quote
      // chars by their escape sequence
  
      $ret = str_replace("\\","\\\\",$string);
      $ret = str_replace("'","\\'",$ret);
      $ret = str_replace("\"","\\\"",$ret);
  
      return $ret;
  }
  </code></pre>
  
  <p>Am I missing anything serious?</p>
  
  <p>Edit: I'm using MySQL by the way.</p>