mysql - PHP Fatal error: class mysqli not found -



mysql - PHP Fatal error: class mysqli not found -

when seek connect using mysqli next error below

fatal error: class panda\mysqli not found , line says "new mysqli" when connects

protected $db = null; public function __construct() { $this->connect(); } public function connect() { global $config; //it errors below here on "new mysqli" $this->db = new mysqli($config['mysqli.host'], $config['mysqli.user'], $config['mysqli.pass'], $config['mysqli.name']); if ($this->db->connect_errno) { echo 'failed connect mysqli: ('; echo $db->connect_errno; echo ') '; echo $db->connect_error; exit(); } $db->set_charset("utf8"); }

you working namespaces , php - default - trying resolve mysqli relative panda namespace. general rule prepend core-php classes \ reside in "global space".

php mysql mysqli

Comments

Popular posts from this blog

c - Compilation of a code: unkown type name string -

java - Bypassing "final local variable defined in an enclosing type" -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -