![]() |
how to output MySQL query results? - 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 to output MySQL query results? (/showthread.php?tid=9867) |
how to output MySQL query results? - El Forum - 07-10-2008 [eluser]Tony W[/eluser] In my controller, I have the following code: Code: $query = $this->db->query("SELECT example FROM slang WHERE `slang` =' $slang_input' "); I wonder how to output the $row->example better? There might be lots of results for this query, maybe I should make it an array and pass it to the view file? thanks how to output MySQL query results? - El Forum - 07-11-2008 [eluser]mironcho[/eluser] In the DB class already exists result_array() method, so you can do: Code: $ret = array(); and then loop through it in your view. |