【发布时间】:2021-05-15 20:48:25
【问题描述】:
我的数据库中有 2 个需要加入的表。 一张桌子是 artikelen 桌子,另一张是收藏桌子。我目前有。
$this->db->select('*');
$this->db->from('collecties');
$this->db->join('artikelen', 'artikelen.collecties_id = collecties.id');
它给出了正确的结果,但所有双字段(collecties 有一个 title 字段,artikelen 有一个 title 字段)将变成一个(它返回 artikelen.title 字段),我无法访问另一个的行表(collecties.title 字段)。
我从 artikelen 中选择了 10 个字段,并且只从收藏中选择了collecties.title。
不用更换的简单方法是什么
$this->db->select('*');
所有 10 个字段都带有 as 语句。
【问题讨论】:
标签: php codeigniter