Php 式中()显示“;是空的;而不是codeigniter中的可变值
结果如下:-Php 式中()显示“;是空的;而不是codeigniter中的可变值,php,mysql,codeigniter,Php,Mysql,Codeigniter,结果如下:- $email='abc@abc.com'; $pass= 123; $this->db->select('*')->from('user')->where('email',$email)->where('password',$pass)-> get()->result(); 但是它与$this->db->query()一起工作 请帮助我找出为什么它不会像:- 'select * from user where email IS NULL
$email='abc@abc.com';
$pass= 123;
$this->db->select('*')->from('user')->where('email',$email)->where('password',$pass)-> get()->result();
但是它与$this->db->query()一起工作代码>
请帮助我找出为什么它不会像:-
'select * from user where email IS NULL and password IS NULL';
使用这种方法。希望对你有帮助
'select * from user where email="abc@abc.com" and password="123" ';
这应该像预期的那样工作。。。你的CI版本是什么?`@sintakonte它的3.1版。6@KiranTrimbake检查下面我的答案。如果您尝试echo$this->db->select('*')->from('user')->where('email',$email)->where('password',$pass)->get_compiled_select(),您会得到什么代码>@sintakonte调用未定义的方法CI_DB_mysqli_driver::get_compiled_select()
$email = "abc@example.com";
$password = "abc123";
public function getdata()
{
// first load your model if not added in your config/autoload file
return $this->db->get_where('table_name', array('email' => $email, 'password' => $password))->row_array();
}