How can i show custom SQL query result at view page - 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: How can i show custom SQL query result at view page (/showthread.php?tid=44074) |
How can i show custom SQL query result at view page - El Forum - 08-02-2011 [eluser]Unknown[/eluser] hi everybody , i am really really newbie for codeigniter i tried many frameworks , django , asp.net mvc & ruby on rails , after many unsuccesfull years , i decided to learn Codeigniter. i am currently using 1.7.3 version related to bundle for e-editor/textmate support i tried to several method foreach , as row , as result but i couldnt able to show my custom sql query on web browser my query = "SELECT SUM( price ) FROM income WHERE `date` >= DATE_SUB( CURDATE( ) , INTERVAL 30 DAY " This query calculates price column total from income table in last 30 day result to me three-digit number i would like to show this query result on view page my controller file: function cashdepot() { } my model file: function cashdepot($income) { } my view file related query: i really i dont have any idea , what should i use. please , can anyone write fill for me function cashdepot() controller { } function cashdepot($income) { } and codes for view Thanks for your kind helps from now |