problem in finding second maximum value - 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: problem in finding second maximum value (/showthread.php?tid=40832) Pages:
1
2
|
problem in finding second maximum value - El Forum - 04-20-2011 [eluser]Bigil Michael[/eluser] but it shows error Quote:A PHP Error was encountered in the model we use Quote:if($query->num_rows() > 0) but it willnot print anything problem in finding second maximum value - El Forum - 04-20-2011 [eluser]Bigil Michael[/eluser] ok ok now it prints result of the person who has maximum votes i want 2nd maximum problem in finding second maximum value - El Forum - 04-20-2011 [eluser]John_Betong_002[/eluser] Modify your SQL so that it returns the top maybe 5 rows (using LIMIT 0,5). Display all the $query-result(). Ensure the data is what you want. It should be the second row->canditate_ votes. Display your results. problem in finding second maximum value - El Forum - 04-20-2011 [eluser]Bigil Michael[/eluser] when the result become 0 ie if the year and constituency_id didnot matches at that time it shows error on controller as undefined property how will i avoid that error????? problem in finding second maximum value - El Forum - 04-20-2011 [eluser]John_Betong_002[/eluser] [quote author="Bigil MM" date="1303310808"] when the result become 0 ie if the year and constituency_id didnot matches at that time it shows error on controller as undefined property how will i avoid that error????? [/quote] The code I supplied had a check to prevent the undefined property error. If you chose to remove the check then the error will always appear. Code: #query = $this->db->query($sql); problem in finding second maximum value - El Forum - 04-20-2011 [eluser]Bigil Michael[/eluser] thank you so much i have solved my problem problem in finding second maximum value - El Forum - 04-20-2011 [eluser]John_Betong_002[/eluser] I am glad I was able to help. Can you mark this post as SOLVED and supply your solution so that others may gain from your knowledge. problem in finding second maximum value - El Forum - 04-20-2011 [eluser]Bigil Michael[/eluser] how to mark it as solved |