CodeIgniter Forums
Help with DB query - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Help with DB query (/showthread.php?tid=11793)



Help with DB query - El Forum - 09-23-2008

[eluser]Unknown[/eluser]
Hello again,

i need perform this part of sql query with activerecord

Code:
SELECT b_articles.*, b_users.*, b_menus.*, COUNT(b_comments.c_id) FROM b_articles, b_users, b_menus, b_comments
but if i try
Code:
$this->db->select('articles, users, menus, COUNT(comments)')
for tables i have prefix 'b_' configured in database.php

How can i select all columns from three tables and 1 COUNT column from fourth table??

Thanks for help