Hi, You don't have to run the select query thrice. In my opinion, this should work.
SELECT media.file_name, users.username, users.creative_specialism
FROM media, users
WHERE media.user_id = users.user_id
ORDER BY date_joined DESC
LIMIT 3
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
It outputs, three records for the user who is at the bottom of the user table, i.e date_joined DESC.
Actually, date_joined DESC should sort the records on date_joined column with the latest date on top. Can you try this query ?
SELECT media.file_name, users.username, users.creative_specialism
FROM media, users
WHERE media.user_id = users.user_id
GROUP BY media.user_id
ORDER BY users.date_joined DESC
LIMIT 3
GROUP BY will group all the records having common user_id in media table, more like, what DISTINCT would do.
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356