I want to select 5 random image from phpbb_attachments
and show author username name from phpbb_users
.
phpbb_attachments: phpbb_topics_posted: phpbb_users:
attach_id topic_id user_id topic_id user_id username
1 10 21 10 21 Tom
2 5 53 5 53 Maria
3 15 11 15 11 John
$result = mysqli_query($con,"SELECT * FROM phpbb3_attachments WHERE mimetype = 'image/jpeg' ORDER BY RAND() LIMIT 5");