Hi,
I'm having a little problem with a MySQL query, heres my table:
fotoID userID
All new posted fotos go to this table, like this:
fotoID userID
1 40
2 40
3 50
So, what I want to do is select the last 6 fotos from this table, but from distinct users.
I tried this:
SELECT * FROM fotos GROUP BY userID ORDER BY fotoID DESC
but when a user have more than 1 foto it doesn't select the last foto from him, I even trie a ORDER BY fotoID, but it doesnt work.
I use a LIMIT 0,6, so I think that the problem is that he's selecting the users with the highest userID, so if an old user post a foto it will not be selected.
So what I need exactly is the last fotos from distinct users.
Any ideas?
thanks