I'm trying to get this query to work:
items.expiration has to evaluate true, and purchases.item_number can't equal items.id. The problem is that when I add the pic part at the end, if one of those evaluates true, the whole thing's true. So, how do I organize it so that one of the pic fields is not empty, and it's not expired and it hasen't been purchased? ThanksCode:SELECT items.id,items.title,items.category,items.expiration,items.price,items.pic1,items.pic2,items.pic3,items.picture,purchases.item_number FROM `items`,`purchases` WHERE items.expiration > '$now' AND purchases.item_number!=items.id AND items.picture != '' OR items.pic1 != '' OR items.pic2 != '' OR items.pic3 != '' ORDER BY RAND() LIMIT 4







Bookmarks