Hi all,
I have a little request. I know it is simple, but my PHP knowledge did not allowed me to do that.
I want to display only the images with the duplicate image name (image_name) on an additional page.
Can someone improve this query for me please?
$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, i.image_postcards".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email")."
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 i.image_name = ******** AND i.cat_id IN (".get_auth_cat_sql("auth_viewcat").")
GROUP BY i.image_name ASC
LIMIT 500
I appreciate the time you use to help me.
Thanks in advance,