gpt4 book ai didi

php - 如何使用 codeigniter 中的左连接 Activity 记录显示来自两个不同表的字段?

转载 作者:可可西里 更新时间:2023-11-01 08:39:39 25 4
gpt4 key购买 nike

function get_all_notification() { //get all notification based on the 'notification' table left join by 'membership' table

$this->db->select()->from('notification')->join('membership','membership.membership_id = notification.notif_id','left'); $notif = $this->db->get();
return $notif->result();
}

I cannot display the fields from membership table.

最佳答案

试试这个

function get_all_notification() { //get all notification based on the 'notification' table left join by 'membership' table

$this->db->select('*')->from('notification')->join('membership','membership.membership_id = notification.notif_id','left');
$notif = $this->db->get();
return $notif->result();
}

关于php - 如何使用 codeigniter 中的左连接 Activity 记录显示来自两个不同表的字段?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39095305/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com