Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/239.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 式中()显示“;是空的;而不是codeigniter中的可变值_Php_Mysql_Codeigniter - Fatal编程技术网

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();

}