I’m trying to build a query which is to be used to populate a dropDownList form field.
I’m looking to build the following SQL statement
...
WHERE
...
AND ([DriverItems].[ItemName] LIKE '%Mini%'
OR [DriverItems].[ItemName] LIKE '%Day Rate%'
OR [DriverItems].[ItemName] LIKE '%Front%'
OR [DriverItems].[ItemName] LIKE '%Rear%')
...
So my question is how does one build multiple OR statements and then make apply them as an AND element to a query in Yii2?
I currently have the following and need to add the extra andWhere with those multiple ORs (shown above) and not sure how to proceed exactly
Compared to writing raw SQL statements, using query builder will help you write more readable SQL-related code and generate more secure SQL statements.