Hello,
I am trying to create a query that is satisfied when either column1 or column2 contains a desired string (stored in variable $search). The following code works but seems to be doing AND instead of OR logic. How to I do OR with where?
Thanks!
I am trying to create a query that is satisfied when either column1 or column2 contains a desired string (stored in variable $search). The following code works but seems to be doing AND instead of OR logic. How to I do OR with where?
Code:
$query->where($db->quoteName('column1') . ' LIKE :search1')->where($db->quoteName('column2') . ' LIKE :search2')->bind([':search1', ':search2'], $search);
Statistics: Posted by JanoD — Tue Jul 09, 2024 9:05 am