![]() |
Preview of db->where statement/s - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Preview of db->where statement/s (/showthread.php?tid=8742) |
Preview of db->where statement/s - El Forum - 05-29-2008 [eluser]php-zbatev[/eluser] is there a way I can preview the output of this: Code: $this->db->where('name', $name); output like: WHERE = name 'Joe' AND title = 'boss' AND status = 'active' Preview of db->where statement/s - El Forum - 05-29-2008 [eluser]Pascal Kriete[/eluser] Not that I'm aware of. You can get the whole query after running it though: Code: $this->db->last_query(); Preview of db->where statement/s - El Forum - 05-29-2008 [eluser]Seppo[/eluser] you can use $this->db->_compile_select(); although you should only use it for debugging Preview of db->where statement/s - El Forum - 05-29-2008 [eluser]php-zbatev[/eluser] [quote author="inparo" date="1212109588"]Not that I'm aware of. You can get the whole query after running it though: Code: $this->db->last_query(); wow, so this one's in the helper i surely did miss that one... thanks a lot this will do the job. :lol: ------------------------------------------------------------------------------------------ [quote author="Seppo" date="1212111723"]you can use $this->db->_compile_select(); although you should only use it for debugging[/quote] this works too, yep I could surely use it for debugging since its not the actual query. thanks a lot. @Seppo: where can i find more of this syntax(_compile_select) because i couldn't see it anywhere in the user guide Preview of db->where statement/s - El Forum - 05-29-2008 [eluser]Derek Allard[/eluser] Yeah, its not in the userguide since we really didn't intend on people using it directly (its used by some CI internals) but you can find it in DB_active_rec.php. @inparo and seppo, you guys are amazing. @zbatev : you're a lucky person! under 10 minutes and you got responses from 2 of the community's finest! Preview of db->where statement/s - El Forum - 05-30-2008 [eluser]Michael Wales[/eluser] I like to toss this in my constructor during development: Code: $this->output->enable_profiler(TRUE); |