php - MySql what's the best way to insert bookings -
i have database looks this
i wondering separate tables , such, insert 1 table @ time, insert row in booking, insert row in customers, , last insert row in booking_has_customers? there easier way this?
halls unchanging in case have more rooms hire.
and when retrieving data database, best use join on foreign keys full overview incase need data?
thanks in advance!
no there no easier way, need insert data each table individually. however, exact situation asks transactions. transactions ensure either required insertions happen, or none of them.
this question pretty broad , cannot answered. if makes sense retrieve data multiple tables, joins answer , foreign keys starting points join condition. join condition may have contain expressions beyond foreign keys. depends actual use case.
i rather ask specific questions specific use cases reports / queries in separate questions. way can answers tailored exact question.
Comments
Post a Comment