class DB {
public function __construct($host, $user, $pass, $base){
$mysqli = new mysqli($host, $user, $pass);
if($mysqli->connect_error){
throw new Exception ('Mysql Connect Error: ('.$mysqli->connect_errono.')'.$mysqli->connect_error);
}else{
$this->mysqli->select_db($base);
}
return $this->mysqli;
}
public function execute($sql){
$this->mysqli = $this->mysqli->query($sql); #35 line
return $this->mysqli;
}
public function __destruct(){
@$this->mysqli->close();
}
} // End
and i getting this error
Fatal error: Call to a member function query() on a non-object in /var/www/db.class.php on line 35
Where is problem?
P.s PHP version is 5.3.3


Sign In
Create Account

Back to top









