26.05.2014, 20:54
I'm learning mysqli and when creating a URL Shortener I get this error: Call to a member function real_escape_string() on a non-object on this line:
I have not forgot to close the class before any one tries to point that out.
PHP код:
$url = $this->db->escape_string($url);
PHP код:
class Shortener {
protected $db;
public function _construct() {
$this->$db = new mysqli('localhost', 'root', '*****', 'shortn');
}