title: Laravel cannot use mysql_real_escape_string()
body: <p>I get a database connection error when trying to use <code>mysql_real_escape_string()</code> within Laravel. Fluent queries work properly so I assume that the database has been configured correctly.</p>
  
  <p>How should <code>mysql_real_escape_string()</code> be used from Laravel? I'm using it to escape the values in a SQL query that I need to build myself due to limitations of Fluent.</p>
  
  <p><strong>PHP Code that builds my own SQL query</strong></p>
  
  <pre><code>    foreach($listings as $listing) {
          $listing = get_object_vars($listing);
          $query = 'INSERT IGNORE into archive ';
          $query .= '(' . implode(',', array_keys($listing)) . ') ';
          $query .= 'VALUES(' . implode(',', array_values( array_map('mysql_real_escape_string', $listing) )) . ')';
          DB::query($query);
      }
  </code></pre>
  
  <p><strong>Error</strong></p>
  
  <pre><code>mysql_real_escape_string() [function.mysql-real-escape-string]: 
  Access denied for user 'nobody'@'localhost' (using password: NO)
  </code></pre>