![]() |
how to see what is behind $query - 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 see what is behind $query (/showthread.php?tid=9809) |
how to see what is behind $query - El Forum - 07-09-2008 [eluser]Mitja[/eluser] Code: $arg = array(); how i can see what is behind $query = $this->db->query("SELECT * from arrangement_event WHERE $searcharg"); Is it possible to see this sql statement that i will se if is everything correct. Thx how to see what is behind $query - El Forum - 07-09-2008 [eluser]Lagarto[/eluser] You can see the Query with "$this->db->last_query();" how to see what is behind $query - El Forum - 07-10-2008 [eluser]walterblaurock[/eluser] Alternatively, you can simply take the contents of the query, and echo them as opposed to inputting them into the query function. Though not as elegant as the above solution, it can be useful as well. Are you using anything such as PHPMyAdmin that can give you specific feedback as to why a query isn't working (I'm assuming that is why you are outputting the query)? During debugging, I often echo the query and paste it into PHPMyAdmin in order to better understand what is going wrong. |