07-11-2011, 06:06 AM
[eluser]dagon[/eluser]
Hello
Im quite new to code igniter and the concept of active record pattern of database handling. I have problems with translating such SQL query into a series of active record method calls:
select TA.*, count(*) as num_entries from table_a AS TA inner join table_b AS TB ON TB.id_category = TA.id GROUP BY TB.id_category ORDER BY num_entries DESC;
Can anyone help ? I have aspecially problems with adapting count(*).
Hello
Im quite new to code igniter and the concept of active record pattern of database handling. I have problems with translating such SQL query into a series of active record method calls:
select TA.*, count(*) as num_entries from table_a AS TA inner join table_b AS TB ON TB.id_category = TA.id GROUP BY TB.id_category ORDER BY num_entries DESC;
Can anyone help ? I have aspecially problems with adapting count(*).