• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with long SQL query

#1
[eluser]ChaosKnight[/eluser]
Hi, this query is for a poll system on the site that I remade:
Code:
$sql = "SELECT v.answer_id, COUNT(v.id) AS NumVotes, a.answer FROM poll_votes v, poll_answers a WHERE v.poll_id='".$poll_id."' AND a.id = v.answer_id GROUP BY a.answer ORDER BY NumVotes DESC";
Can someone tell me if it's possible to convert this query in CodeIgniter's ActiveRecord queries? Or will it be better to run that query with the regular query function?:
Code:
$this->db->query($sql);

Thanks


Messages In This Thread
Help with long SQL query - by El Forum - 06-24-2010, 08:55 AM
Help with long SQL query - by El Forum - 06-24-2010, 09:49 AM
Help with long SQL query - by El Forum - 06-24-2010, 12:00 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.