im having problems concatenating this query:
$sql.=' WHERE ticket.dept_id IN('.implode(',',$thisuser->getDepts()).') OR ticket.staff_id='.db_input($thisuser->getId());
with this:
AND ticket.brand_id IN('.implode(',',$thisuser->getBrands())
how can i achive this?
You could concat the string on the same-line with:
Or you could do it on a second line:
However, because your original
WHEREclause contains anOR, you’ll have to make sure to keep your logic intact. I would suggest to wrap the first two conditions in a single-set of parentheses before concatenating the additionalANDclause: