CodeIgniter Forums
View Active Record Query String? - 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: View Active Record Query String? (/showthread.php?tid=21279)



View Active Record Query String? - El Forum - 08-05-2009

[eluser]jpschroeder[/eluser]
Is it possible to view the actually query string that is generated by activerecord? I would like to be able to see what is actually being run in certain circumstances. Example:

Code:
$this->db->select("*");
$this->db->from("checklist");
$this->db->join("checklist_progress","checklist_progress.checklist_item = checklist.id");
$this->db->where("user",$user);

Now I want to actually see what that creates as a query string. Any love?


View Active Record Query String? - El Forum - 08-05-2009

[eluser]jcavard[/eluser]
here's some love <3


View Active Record Query String? - El Forum - 08-05-2009

[eluser]Krzemo[/eluser]
http://ellislab.com/forums/viewthread/96428/

Smile


View Active Record Query String? - El Forum - 08-05-2009

[eluser]Travis O[/eluser]
You could also use profiling to display the query as it is run on the page.

http://ellislab.com/codeigniter/user-guide/general/profiling.html


View Active Record Query String? - El Forum - 08-05-2009

[eluser]jpschroeder[/eluser]
thanks guys. I searched the forums and didn't find that one. Appreciate it!


View Active Record Query String? - El Forum - 08-05-2009

[eluser]jcavard[/eluser]
[quote author="Travis O" date="1249512308"]You could also use profiling to display the query as it is run on the page.

http://ellislab.com/codeigniter/user-guide/general/profiling.html[/quote]
the profiling is really useful, but I was not aware of this one
Code:
$this->db->_compile_select();
and that is mervelous!
thanks