且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我们如何在Active记录多个连接codeigniter

更新时间:2022-12-11 20:23:31

也许这就是你追求的是什么...

Perhaps this is what you're after...

$query = $this->db->select('suppliers.*, category.strCategory, category_1.strCategory AS strParent, tblcitylist.city_name')
            ->from('suppliers')
            ->join('category',                  'suppliers.intCat=Category.intId',          'inner')
            ->join('tblcitylist',               'suppliers.intCity=tblcitylist.city_id',    'inner')
            ->join('category as `category_1',   'category.intParent=Category_1.intId',      'left')
            ->where('status','y')
                ->get();

CI DB文档: http://ellislab.com/codeigniter /用户指南/数据库/ index.html的