Select statement not returning the 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: Select statement not returning the value (/showthread.php?tid=59878) |
Select statement not returning the value - El Forum - 12-04-2013 [eluser]cerberus478[/eluser] Hi I'm doing a select statement using active records. When I print_r($data) to see if it is returning the values all i get is Quote:Array ( [menus] => ) 1 I have 2 records in my table. menus controller Code: function order_ajax(){ and my menus_model Code: function get_table() { Select statement not returning the value - El Forum - 12-04-2013 [eluser]noideawhattotypehere[/eluser] Code: return $query->result_array(); Select statement not returning the value - El Forum - 12-04-2013 [eluser]cerberus478[/eluser] I tried that and I got Quote:Fatal error: Call to a member function result_array() on a non-object in /Applications/MAMP/htdocs/untitled/application/modules/menus/models/menus_model.php on line 26 Select statement not returning the value - El Forum - 12-04-2013 [eluser]CroNiX[/eluser] Code: $query = $this->db->get('$table'); Remove the single quotes from around $table. You are turning the variable into a literal string of "$table" instead of what $table contains. Select statement not returning the value - El Forum - 12-04-2013 [eluser]cerberus478[/eluser] That worked thanks. Is there a way to mark the thread solved? |