I the following query, which works quite well. I either select everything, when colname='rand' or the results of filtering drop down boxes. You can see it in action at:
https://www.artcardsforcauses.com/gallery.php?thm=rand . What I would like it to have this initial view, when no filtering is selected, to be a random selection of art work from the last 90 days.
SELECT *
, country_art
FROM image_img
LEFT JOIN label
ON id_lbl=(theme_img
OR style_img
OR medium_img
OR season_img)
LEFT JOIN artist_art On artist_img=user_art
WHERE approvedIMG=1
AND private_img <> 1
OR `private_img`IS NULL
AND (colname LIKE 'rand')
OR( artist_img = colname2
AND theme_img LIKE %colname3%
AND medium_img LIKE %colname4%
AND style_img LIKE %colname5%
AND season_img LIKE %colname6%
AND country_art LIKE %colname7%)
ORDER BY cdates_img DESC
(I hope this formatting works for Rudy!)
Nick