Query translation in Active Record format - 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: Query translation in Active Record format (/showthread.php?tid=53281) |
Query translation in Active Record format - El Forum - 07-17-2012 [eluser]Alhazred[/eluser] How to write this query in Active Record format? Code: SELECT c.id AS id,c.name AS name,t.name AS category Query translation in Active Record format - El Forum - 07-17-2012 [eluser]Alhazred[/eluser] Here what I've tried Code: $this->db->select('c.id AS id, c.name AS name, t.name AS category'); Query translation in Active Record format - El Forum - 07-18-2012 [eluser]Aken[/eluser] Try: Code: $this->db->where('t.id = c.category'); Query translation in Active Record format - El Forum - 07-18-2012 [eluser]Alhazred[/eluser] Thenks, it works. |