mysqli->real_escape_string
<p>I got a problem with real_escape_string</p>

<p>code:</p>

<pre><code>function mysql_escape($str){
    echo '&lt;pre&gt;';
    var_dump(self::$link);
    echo '&lt;/pre&gt;';

    return self::$link-&gt;real_escape_string($str);
}
</code></pre>

<p>output:</p>

<pre><code>object(mysqli)#1 (17) {
  ["affected_rows"]=&gt;
  NULL
  ["client_info"]=&gt;
  NULL
  ["client_version"]=&gt;
  int(50051)
  ["connect_errno"]=&gt;
  int(0)
  ["connect_error"]=&gt;
  NULL
  ["errno"]=&gt;
  NULL
  ["error"]=&gt;
  NULL
  ["field_count"]=&gt;
  NULL
  ["host_info"]=&gt;
  NULL
  ["info"]=&gt;
  NULL
  ["insert_id"]=&gt;
  NULL
  ["server_info"]=&gt;
  NULL
  ["server_version"]=&gt;
  NULL
  ["sqlstate"]=&gt;
  NULL
  ["protocol_version"]=&gt;
  NULL
  ["thread_id"]=&gt;
  NULL
  ["warning_count"]=&gt;
  NULL
}



Warning:  mysqli::real_escape_string() [mysqli.real-escape-string]: Couldn't fetch mysqli in /usr/www/users/.../class/class.Data.php on line 188
</code></pre>
