Hello. The problem is, I have a table ROOMS :
id, slot_1, slot_2, slot_3, slot_4, slot_5 And there is also a USERS table:
uid, name How to make such a thing so that each slot_N is associated with USERS ?
The fact is that I do this inside phpMyAdmin, there I don’t understand how to establish connections at all, but it seems like I did everything with indices, but how do I prescribe a LEFT JOIN during the selection?
rooms_id, ползователь такой-тоrecords, therooms_id, ползователь такой-тоor one record with 5 names, id and what else does the user have? PS In general, you have a base in a very strange form, many columns with user id clearly violate even the initial normal forms. Maybe you should think about a different base structure - MikeSELECT * FROM rooms r LEFT JOIN users u1 ON r.slot_1 = u1.id LEFT JOIN users u2 ON r.slot_2 = u2.id LEFT JOIN users u3 ON r.slot_3 = u3.id- androschukroom(id, slot); user(id, name); user_room(room_id, user_idroom(id, slot); user(id, name); user_room(room_id, user_idroom(id, slot); user(id, name); user_room(room_id, user_idthen and with a change in the number of rooms there is no need to change the structure of the base - androschuk