Jump to content

OR selectors with blank values create SQL errors


Neeks
 Share

Recommended Posts

I'm looking  to use an OR selector with blank values. 

project=1024|''  : RESULT:  SQLSTATE[42000]: Syntax error or access violation: 1066 Not unique table/alias: 'field_project'

project=1024|    : RESULT:  same as above.

I basically want all the results for "project=" and all the results for "project=1024" in one nice little result. 

Any one know how I can accomplish the same result in another way?

ProcessWire Version 2.5.3 

Link to comment
Share on other sites

It does work with just the ID. I also got an SQL error of 1066, but I tried a bunch of invalid stuff trying to make that query work how I wanted it ;-)

The OR groups did exactly what I needed. Thanks!

They are such an elegant and simple solution. I remember when they groupings where first introduced to the API and I don't think I really understood them and how helpful they where until now. 

Thanks LostKobrakai!!!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...