title: Can't use mysql_real_escape_string
body: <p>So, I'm getting this warning when using mysql_real_escape_string</p>
  
  <pre><code>Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'username'@'localhost' (using password: NO) in /home/path/php/functions.php on line 11
  </code></pre>
  
  <p>The rest of the site works fine, connects to the DB and all, but I get an error when using this function. </p>
  
  <p>It works completely fine on my localhost testing server.</p>
  
  <p>Any ideas?</p>
  
  <p>I use aforementioned function in my own homebrew string sanitation function:</p>
  
  <pre><code>function sani($string){     
    $string = strip_tags($string); 
    $string = htmlspecialchars($string); 
    $string = trim(rtrim(ltrim($string))); 
    $string = mysql_real_escape_string($string);
    return $string;
  }
  </code></pre>
  
  <p>And I use this function every time I do queries...</p>
  
  <pre><code>function mm_mysqlquery($query) {
   if (MM_DEBUG == true) { echo "Query: $query &lt;br&gt;"; mm_log("Query: $query"); } //print query if MM_DEBUG
   $link = mysql_connect(DB_HOST, DB_USER, DB_PASS) or die ("mysql_error: " . mysql_error());
   $db_selected = mysql_select_db(DB_NAME);
   return mysql_query($query, $link);
  }
  </code></pre>
  
  <p>Thanks on beforehand!</p>