Welcome Guest, Not a member yet? Register   Sign In
Convert query to Active Record?
#1

[eluser]digity[/eluser]
How do I break down or modularized the query below using Active Records?

Code:
SELECT users.username, comments.user_id, COUNT(*) as comment_count FROM users, comments WHERE comments.topic_id='.$topic_id.' AND users.user_id=comments.user_id GROUP BY user_id ORDER BY comment_count DESC

Thanks in advance




Theme © iAndrew 2016 - Forum software by © MyBB