You can pass the "glue" as a second argument.
Note it can only bet set in the first call. To change it later you have to use extendWhere() with first argument as the new outer "glue":
This will result in a query like this:Also, instead of multiple where/extendWhere() calls you can pass an array:
Code:
$query->where($db->quoteName('column1') . ' LIKE :search1', 'OR')->where($db->quoteName('column2') . ' LIKE :search2')
Code:
$query->extendWhere( 'AND', $db->quoteName('column3') . ' LIKE :search3');
Code:
SELECT * FROM #__table WHERE (`column1` LIKE :search1 OR `column2` LIKE :search2) AND (`column3` LIKE :search3)
Code:
$query->where( [ $db->quoteName('column1') . ' LIKE :search1', $db->quoteName('column2') . ' LIKE :search2', ], 'OR');
Statistics: Posted by SharkyKZ — Tue Jul 09, 2024 11:08 am