So here is my dilemma. I want to show the most RECENT image submissions to my gallery. The problem is that sometimes the most recent submissions are by the same person. I'd prefer for a person to show up only once, since sometimes most people upload more than one photo at a time.
For Reference My Tables Are (simplified)
Users
user_id, username
Gallery
media_id, user_id, filename, date_added
This is my current query:
SELECT g.*
, u.user_id
, u.fullname AS real_name
FROM gallery g
LEFT
JOIN users u
ON u.user_id = g.user_id
WHERE g.status = 'approved'
ORDER
BY g.date_added DESC
LIMIT 10
So I get things like:
user_id: 9000 7383idsj39390.jpg
user_id: 9000 sdujnfsd83ss2.jpg
user_id: 829 sdfs3dgsdfsd3.jpg
user_id: 1000 dsfsdfsd34523.jpg
Ideally, I'd like for the user to be unique users.
user_id: 9000 7383idsj39390.jpg
user_id: 829 sdfs3dgsdfsd3.jpg
user_id: 1000 dsfsdfsd34523.jpg
user_id: 500 29928sdksdui2.jpg
I really have no idea how to approach this. Any help would be appreciated!