CountVotes where ansid - 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: CountVotes where ansid (/showthread.php?tid=22468) |
CountVotes where ansid - El Forum - 09-10-2009 [eluser]benfike[/eluser] How can I count the votes number for a ansid? Code: votes_answer Thats my tables! Code: function countVotesByAnsId($id){ http://www.arsenalfan.hu/szavazas/eredmeny/1 here you view the problem. The total votes: 12 Something has 9 votes this true. But the "Valami" only has 3 votes and this write 9 again. I hope you know what I speak CountVotes where ansid - El Forum - 09-10-2009 [eluser]jedd[/eluser] I think your schema is .. sub-optimal. Can you describe it a bit better? Also $this->db->count_all_results() is your friend. |