[eluser]nmormino[/eluser]
[quote author="XtraFile" date="1210909812"]Aww, I just submitted a bug report on this as well.
An empty WHERE statement should be '', WHERE is considered a string by the Database engine and a value, even if empty, IS needed for valid syntax.
I propose the following code change, added after line 463:
Code:
else if($v === '')
{
$v = " ''";
}
There should be no escaping here, no need to escape nothing.
-Matt[/quote]
This works perfectly fine for me. Funny thing is, i implemented this same fix before having read it. Also for the whole debate about submitting an empty string.
Code:
$this->db->where('field', '');
If you were to ask me, I would say I'm submitting an empty string, not submitting "nothing", submitting nothing would be
Code:
$this->db->where('field', );
and we all know that PHP would choke on this.
But still, thanks DEV team, CodeIgniter has been a staple in my site development for a year now and I find it irreplaceable. The fix for this bug is so simple and it seems that many people have gotten a little bent out over it.
-Noah