I have 2 tables, rooms and images, and I want to show rows with all the rooms I have for that specific hotel and also show me the each images from the rooms, but the problems is when I use JOIN SELECT is show me 8 rows from all the queries from the second tables, which means is showing me 3 times(i have 3 images for this room) the single room and 5 times the double rooms (i have 5 images for this room) so is showing me 8 rows, and I want only 2 rows for each rooms with each images - 3 and 5
table 1 - rooms
id, id_hotel, type_room
1, 1, single
2, 2, double
table 2 - images
id, id_rooms, url
1, 1, image-A.jpg
2, 1, image-b.jpg
3, 1, image C.jpg
4, 2, image D.jpg
5, 2, IMAGE E.jpg
6, 2, IMAGE f.jpg
7, 2, IMAGE g.jpg
8, 2, IMAGE h.jpg
How I can Do?? I tried also RIGHT JOIN and LEFT JOIN ... other solution?
echo type_room / single
echo type_room / single