php real_escape_string
<p>I post the data of dynamically generated textbox in PHP. When I post the data using <code>real_escape_string()</code>, i.e:</p>

<pre><code>$ingredient = mysql_real_escape_string($_POST['ingredient']);
</code></pre>

<p>...it doesn't post data from textbox and I use simple <code>$_POST[''];</code> method i.e:</p>

<pre><code>$ingredient = $_POST['ingredient'];
</code></pre>

<p>...it gives me error when I use a single quote (<code>'</code>) in my text.</p>

<blockquote>
  <p>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 's', 'fgad', '55')' at line 2</p>
</blockquote>

<p>this was my old post <br/> i solved the problem locally by enabling <code>magic_quotes_gpc = On</code> but when upload this on my server it does't work again so how can i turn on magic quotes on server.</p>
