我正在查询名为“用户”的表格。但它不起作用,它正在查询会话表。
show last query的输出是:
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'
我是"从用户中选择用户。*#34;。
为什么它会从会话表中拉出来?
我的查询代码在这里:
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;
}