Fatal Error : Call to undefined method Database::query()
I am having an error ( Fatal Error : Call to undefined method
Database::query() ) somewhere in this part, I don't know where is this
coming from. Because I just changed my constructor
Class Database{
public function __construct(){
$this->getConn();
}
public function getConn(){
return new mysqli("localhost", "root", "", "os_db");
}
public function select($query){
$data = array();
if($result = $this->query($query)){
while($row = $result->fetch_assoc()){
$data[] = $row;
}
}else{
$data = array();
}
return $data;
}
}
No comments:
Post a Comment