我想从我的数据库中获取一些数据与活动记录,我有以下问题。我想学习如何使用活动记录来做到这一点,因为在这段代码后,我有很多连接和其他的东西。否则,我会写一个正常的查询。db活动记录
$this->db->where("sa.country", $country);
// I NEED TO OPEN BRACKETS HERE SO THAT I CAN GET THE LANGUAGES IF THERE IS DATA IN ONE OF THE ARRAYS
if (isset($lid[0]))$this->db->where("sa.lang", $lid[0]);
if (isset($lid[1]))$this->db->or_where("sa.lang", $lid[1]);
if (isset($lid[2]))$this->db->or_where("sa.lang", $lid[2]);
if (isset($lid[3]))$this->db->or_where("sa.lang", $lid[3]);
if (isset($lid[4]))$this->db->or_where("sa.lang", $lid[4]);
//AND CLOSE THEM HERE
我的目标是从数据库中获取一个特定的国家以及数组中相应的语言。
刚刚尝试过。清洁和工作很好,谢谢! – Ando
不客气! – uzsolt