pdoResources where clause

Hello,

I have a listbox (multiple select TV) called Dicipline and I would like to use pdoResources’ &where clause to filter the result. The stored options are Ceramics, Film, Glass, Painting, Photography etc.

If I am looking for a single match, then &where=Discipline==%Film% works a treat but if I want to et a listing of say all Photography and Film resources then I get an SQL error:

I have tried:
&where=[{"Discipline==":"%Photography%", "OR:Discipline==":"%Film%"}]

Could not process query, error #1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘[{"TVdiscipline.value LIKE ‘":"%Photography%"’ AND "OR:TVdiscipline.`va’ at line 1

&where=[{"Discipline.value:=":"%Photography%", "OR:Discipline.value:=":"%Film%"}]

Could not process query, error #1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘[{"TVdiscipline.value.value:=":"%Photography%" LIKE ‘’ AND "OR:`TVdiscipline’ at line 1

How do I check using 2 or more values that are OR together?

Kind regards

James

Maybe you can use the &tvFilters property:

&tvFilters=`Discipline==%Photography%||Discipline==%Film%`
1 Like

You should think about using Tagger for this.

If you decide you need a &where property, give this a shot:

&where = `[{"Discipline:LIKE":"%Photography%"},{" or:Discipline:LIKE":"%Film%"}]`

If the entries are exact, this might also work:

&where = `[{"Discipline":"Photography"},{" or:Discipline":"Film"}]`

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.