[英]Join more than two tables in codeigniter
我有4个表,我想在codeigniter中一起加入那些表。 是否可以使用codeigniters加入方法?
如果您正在使用CodeIgniter的Active Record类,则可以多次使用join
方法来连接多个表。
$this->db->join('table2', 'table2.ID = table1.ID');
$this->db->join('table3', 'table3.ID = table1.ID');
$this->db->join('table4', 'table4.ID = table1.ID', 'left');
我假设您正在谈论加入SQL数据库表,这是正确的吗? 如果是这样,您始终可以使用CodeIgniter SQL方法,请参阅: http : //codeigniter.com/user_guide/database/queries.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.