|
初次使用CI框架,在使用$this->load->database();加载数据类时报错:
A PHP Error was encountered
Severity: Warning
Message: mysqli_init(): Property access is not allowed yet
Filename: mysqli/mysqli_driver.php
Line Number: 126
代码如下:
Class student extends CI_Controller{
public function getAll(){
echo "get All...";
$this->load->database();
//var_dump($this->db);
//$student_sql = "";
}
}
数据库配置:$active_group = 'default';
$query_builder = TRUE;
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => 'root',
'password' => '',
'database' => 'test',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => TRUE,
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
本地开发环境:httpd-2.4.12-win32-VC11 php-5.6.9-Win32-VC11-x86 mysql-5.6.14 x86使用$db = mysqli_connect("localhost", "root", "");连接数据库是没有问题的。
请问该问题如何解决?谢谢!
|
|