I have these 2 tables:
ornaments (ornament_id, ornament_name)
ornament_to_size (ornament_id, size_id, ornament_type, colour, material, finish, height, width, weight, location, price, description, image_path)
And I want to create a form in admin to insert a new ornament item into the database. What would be the best way of doing this? I need to insert in both tables which is making it more difficult for me. The ornament_id in the ornaments table is obviously the PK and the PK in the ornament_to_size table is ornament_id and size_id as a composite key.
The reason there is an ornament to size table is because an ornament can have more than one size like so:
ornament_id = 3 & size_id = 1
ornament_id = 3 & size_id = 2
ornament_id = 3 & size_id = 3
I just want to know what the method would be not the actual code
lastInsertId) which you will need to insert the ornament size rows. Does this answer the question?