the sql queries are echoed out 'how to stop it? |
[eluser]shait[/eluser]
how can i avoid the queries echoed out? why it happens?
[eluser]InsiteFX[/eluser]
Kind of hard to tell without seeing the code. We are not mind readers and have crystal balls. And please use code tags when posting the code.
[eluser]shait[/eluser]
this is what i return to the controller Code: return $this->db->get('contactform'); SELECT * FROM contactform the debug mode is on false that's all thanks
[eluser]astroanu[/eluser]
of course it should return a mysql query. read the CI doc again on how to use the db class. Code: $query = $this->db->get('contactform'); or return the result as an array Code: $query = $this->db->get('contactform');
[eluser]PhilTem[/eluser]
@astronau: That's wrong. It actually returns a resource handle that is related to the result of a MySQL-query. If you do a Code: $query = $this->db->get('contactform'); you will get a resource handle type (refer to the "Return Values"-section on mysql-query help. That said, it isn't a query and you cannot really echo it as well. The only thing you can echo is Code: echo $this->db->last_query(); which holds the last query-string. Anyways, usually no queries are echoed/printed on your screen unless you echo/print them. Even the debug mode set to TRUE will not echo the queries.
[eluser]NeoArc[/eluser]
Make sure you don't have the ci debugger enabled: $this->output->enable_profiler();
[eluser]shait[/eluser]
thanks all for the answers, i followed your advise but the query is still echoing out. I think it is strange and i cant find the reason if you have more ideas that will be great
[eluser]CroNiX[/eluser]
Well, you need to go through all of your code to see where you are echoing it out. We can't do that for you. Go through the controller, any model being used in that controller, the views, helpers, anything that is being used to generate that page. |
Welcome Guest, Not a member yet? Register Sign In |