【发布时间】:2018-07-18 07:07:15
【问题描述】:
我有两张桌子competition_registration 和competition_schedule。我有从competition_registration 中选择行的选择查询。这是我的代码,如下所示:
$this->db->select('competition_registration.permenent_registration_number');
$this->db->from('competition_registration');
$where = "permenent_registration_number is NOT NULL";
$this->db->where($where);
$this->db->join('competition_schedule', 'competition_schedule.competition_schedule_id = competition_registration.competition_schedule_id');
$this->db->join('competition_schedule', 'competition_schedule.period_id = 6');
$this->db->join('competition_schedule', 'competition_schedule.competition_level_id = 3');
$query = $this->db->get(); echo $this->db->last_query();exit;
但这显示错误。任何人都可以检查这个查询并为我纠正它吗?
我想从competition_schedule_id 和competition_level_id 等于3 和period_id 等于6 的competition_schedule 表中选择两个表中的列。
【问题讨论】:
标签: php codeigniter codeigniter-3 codeigniter-query-builder