这些是我在Codeigniter的数据库配置文件中的设置:
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => 'root',
'password' => '',
'database' => 'admin',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => FALSE,
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
即使我将debuging设置为false,但在此功能之后仍然会在我的页面上显示错误:
if ($this->db->update_batch($batch_data, 'id'))
{
echo 'Success';
}
else
{
echo 'Error';
}
我知道为什么会发生这种情况(错误的id值,在这种情况下缺少参数)但我不知道为什么会显示错误,更重要的是为什么返回时没有false
?相反,它返回“发生数据库错误”块!