定义方法 CI_DB_mysqli_result::where()
defined method CI_DB_mysqli_result::where()
我是 CI 的新手,根据文档我已经输入了代码,但我仍然遇到错误...
Fatal error: Call to undefined method CI_DB_mysqli_result::where() in
C:\xampp\htdocs\Nalanda_Library\application\models\SuperUserlogin.php
on line 8
my model code is like these
class SuperUserLogin extends CI_Model{
public function checkinglogin($username,$password){
$password = md5($password);
$username;
$array=array('admin_username'=>$username,'admin_password'=>$password);
$row=$this->db->get('admin')
->where($array);
if($row->num_rows()){
return $row->row->admin_user_id();
}
}
}
使用 CI 的 get_where()
method。
$query = $this->db->get_where('mytable', array('id' => $id), $limit, $offset);
我是 CI 的新手,根据文档我已经输入了代码,但我仍然遇到错误...
Fatal error: Call to undefined method CI_DB_mysqli_result::where() in C:\xampp\htdocs\Nalanda_Library\application\models\SuperUserlogin.php on line 8 my model code is like these
class SuperUserLogin extends CI_Model{
public function checkinglogin($username,$password){
$password = md5($password);
$username;
$array=array('admin_username'=>$username,'admin_password'=>$password);
$row=$this->db->get('admin')
->where($array);
if($row->num_rows()){
return $row->row->admin_user_id();
}
}
}
使用 CI 的 get_where()
method。
$query = $this->db->get_where('mytable', array('id' => $id), $limit, $offset);