CodeIgniter Forums
CI_DB_active_record:generation of OR AND is not correct, If we want to use or_like we still get AND - 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: CI_DB_active_record:generation of OR AND is not correct, If we want to use or_like we still get AND (/showthread.php?tid=46638)



CI_DB_active_record:generation of OR AND is not correct, If we want to use or_like we still get AND - El Forum - 11-09-2011

[eluser]Unknown[/eluser]
Hello, I found one thing, maybe bug.

Code:
or_where(k,v);
or_like(k1,v1);

result:
Code:
WHERE k=v AND (NOT OR as expected) k1=v1
because

(Line 685 CI_DB_active_record)
Code:
$prefix = (count($this->ar_like) == 0) ? '' : $type;

What if
Code:
(count($this->ar_where) > 0
?

If we want to use or_like we still get AND

I hope my problem is clear