i have this code..
$asc_desc = ( rand(0,1) ) ? "DESC" : "ASC";
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name")."
FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id IN (".get_auth_cat_sql("auth_viewcat").")".$selection_cutoff[$cnt]."
ORDER BY i.image_".$selection[$cnt]." ".$asc_desc.", i.image_".$selection_alt[$cnt];
how can i change the query (if its possible) to make it so that it will still show the random asc/desc, but where it will only show the results if there is more than where (like a where count=>1)
im using this on a image site, and it shows randomly the highest and lowest pictures of different categories (ex: highest/lowest hits, comments, etc)
any ideas?
the page in question is here..
http://www.abda53.com