Page 1 of 1

[RESOLVED] Complex WHERE conditions...

Posted: Sun Oct 05, 2008 12:38 pm
by NnM
I want to make a query like this:

Code: Select all

 
SELECT * FROM blah WHERE cond1 = 'yeah' AND (cond2 LIKE '%search%' OR cond3 LIKE '%search%')
 
On other words, where cond1 is equal to something and either cond2 or cond3 is equal to something else.

What I tried above throws off a MySQL syntax error. Help?

Re: Complex WHERE conditions [WHERE x=y AND (d=a OR b=c) ]

Posted: Sun Oct 05, 2008 12:41 pm
by onion2k
That should work fine. Can you show us the query that's giving a syntax error?

Re: Complex WHERE conditions [WHERE x=y AND (d=a OR b=c) ]

Posted: Sun Oct 05, 2008 12:48 pm
by NnM
Sorry. It was just a typo. ><