title: mysql_real_escape_string() not working, even though I'm connected to the database
body: <p>I don't think my code's the problem because it's working on my local server (EDIT: sorry if this was the wrong place to ask, but I can't move to ServerFault by myself). On the remote server, though, I can't get <code>mysql_real_escape_string()</code> to work. The database connection <strong>is</strong> working, and I'm connecting before calling the function.</p>
  
  <p>When I try <code>echo $_POST['email'];</code>, I get the right data, but when I try <code>echo mysql_real_escape_string($_POST['email']);</code> I get nothing.</p>
  
  <p>Here's I get when I leave error reporting on:</p>
  
  <pre><code>Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: [2002] No such file or directory (trying to connect via unix://please_see_the_faq) in /f5/mysite/public/email_results.php on line 11
  
  Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: No such file or directory in /f5/mysite/public/email_results.php on line 11
  
  Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in /f5/mysite/public/email_results.php on line 11
  </code></pre>
  
  <p>Is it possible that something with the PHP configuration is causing this? I'm hosting with NearlyFreeSpeech, if it matters.</p>
  
  <p>Here's my insert code:</p>
  
  <pre><code>$db-&gt;query('INSERT INTO emails VALUES ("sampleemail@gmail.com")');
  </code></pre>
  
  <p>And here's how I'm connecting to the database:</p>
  
  <pre><code>@ $db = new mysqli('mysite.db', 'wizard', '(password)', 'mysite');
  </code></pre>