Page 1 of 1

php Query problem, dunno how to call it :s

Posted: Wed Aug 11, 2004 6:00 am
by potato
Hi evrybody!

Is there a way that i can make a 'where blahblah = annything query'? If you get what i mean.
For example:

this way, i select everything where active = 1 and genre1 = $genre or genre2 = $genre

Code: Select all

$query = "SELECT * FROM bands WHERE active = 1 AND genre1 = '$genre' OR genre2 = '$genre'";

this i what i think it should be, but doesn't work.
Select everything where active = 1 and genre1 = (annything) or subgenre = (annything)

Code: Select all

... WHERE active = 1 AND genre1 = * OR genre2 = * ";

I hope there is a way to do it, would be very helpfull.

Posted: Wed Aug 11, 2004 6:26 am
by JayBird

Code: Select all

Code: 
... WHERE active LIKE '%' AND genre1 LIKE '%' OR genre2 LIKE '%' ";

Posted: Wed Aug 11, 2004 6:45 am
by potato
Thank you very much. :D