Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/67.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
Mysql 代码点火器查询错误的表-会话_Mysql_Codeigniter - Fatal编程技术网

Mysql 代码点火器查询错误的表-会话

Mysql 代码点火器查询错误的表-会话,mysql,codeigniter,Mysql,Codeigniter,我正在查询一个名为“users”的表。但它不工作,而是查询会话表 show last查询的输出为: SELECT * FROM (`sessions`) WHERE `session_id` = '034594375ce4c6f3d1b3b95c5cfc5bed' AND `user_agent` = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:39.0) Gecko/20100101 Firefox/39.0' 我正在从用户中选择用户。

我正在查询一个名为“users”的表。但它不工作,而是查询会话表

show last查询的输出为:

SELECT * FROM (`sessions`)
WHERE `session_id` = '034594375ce4c6f3d1b3b95c5cfc5bed'
AND `user_agent` = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:39.0) Gecko/20100101 Firefox/39.0'
我正在从用户中选择用户。*

为什么它会从会话表中退出

我的查询代码如下:

public function getByBlpIdSmallJoin($blp_id)    {
    $this->db->select('nlp_screenings.*,nlp_screenings.id as nlp_screening_id,screenings.*, screenings.id as screening_id, nlp_screenings.launched as nlp_screenings_launched, DATE_FORMAT(screenings.screening_time, "%c/%d/%Y") as screening_date, DATE_FORMAT(screenings.screening_time, "%h:%i %p") as the_screening_time', FALSE);
    $this->db->from($this->db_table_name);
    $this->db->join('screenings', 'nlp_screenings.screening_id=screenings.id');
    $this->db->join('blp', 'blp.id=nlp_screenings.blp_id');
    $this->db->where('blp_id', $blp_id);
    $this->db->where('archive', '0');
    $this->db->where('printed_pass', '0');
    $query = $this->db->get()->result();
    echo $this->db->last_query();

    return $query;
}

如果不看你的代码,就很难知道你还需要什么代码?问题中生成SQL查询的CodeIgniter模型你向我们展示的是结果,而不是生成此结果的代码,问题在于生成此结果的代码,因此,显示结果并不能提供任何有用的信息来帮助我们。如果您执行var_dump$this->db->querys;,您会得到什么;?这将输出已运行的查询列表