View Full Version : 2 WHERE declarations?

03-21-2007, 11:33 PM
Can I use 2 where declarations?

Heres an example. Now the && I don't know if it works. How should I go about this? I want to get an artist with the name $artist, that is active yes.

$getfiles = mysql_query("SELECT * FROM `artists` WHERE `name`='$artist' && `active`='y'");

03-21-2007, 11:41 PM
You can use it like that, but I'm not sure if && works, I've always used AND

03-21-2007, 11:41 PM
I believe && and || will work but you should use AND and OR for clarity.

03-21-2007, 11:47 PM
ohhh. duhhhhhh. I knew this. darn it.

Thanks guys ;) rep to both.