Welcome Guest, Not a member yet? Register   Sign In
Preview of db->where statement/s
#1

[eluser]php-zbatev[/eluser]
is there a way I can preview the output of this:

Code:
$this->db->where('name', $name);
$this->db->where('title', $title);
$this->db->where('status', $status);

output like:
WHERE = name 'Joe' AND title = 'boss' AND status = 'active'
#2

[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();
#3

[eluser]Seppo[/eluser]
you can use $this->db->_compile_select(); although you should only use it for debugging
#4

[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();
[/quote]

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
#5

[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!
#6

[eluser]Michael Wales[/eluser]
I like to toss this in my constructor during development:
Code:
$this->output->enable_profiler(TRUE);




Theme © iAndrew 2016 - Forum software by © MyBB