Call to a member function escape_string() on a non-object
#1

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:
PHP код:
$url $this->db->escape_string($url); 
PHP код:
class Shortener {
    protected 
$db;
    public function 
_construct()  {
        
$this->$db = new mysqli('localhost''root''*****''shortn');
    } 
I have not forgot to close the class before any one tries to point that out.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)