Retrieving from database - 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: Retrieving from database (/showthread.php?tid=52166) |
Retrieving from database - El Forum - 05-31-2012 [eluser]Coder Death[/eluser] Hello to all, I have my model with this function : Code: function getReportByDate(){ in my controller I do this : Code: $this->load->model('getreport'); And in the view I get the data like this : Code: <?php But I have this error : Code: Object of class stdClass could not be converted to string Please how can I solve this problem ? Thanks Retrieving from database - El Forum - 05-31-2012 [eluser]weboap[/eluser] 1 - in the model don't loop thru result use Code: ... 2- in controller Code: //will be only you are returninf a false if no data. in view Code: //remimber the report we are getting in the view is either false or an array. good luck Retrieving from database - El Forum - 05-31-2012 [eluser]Coder Death[/eluser] @Weboap, yes it works, very simple lol Thanks a lot |