title: Send html form data to two separate tables in the database using sql and php
body: <p>I have these 2 tables:</p>
  
  <pre><code>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)
  </code></pre>
  
  <p>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.</p>
  
  <p>The reason there is an ornament to size table is because an ornament can have more than one size like so:</p>
  
  <pre><code>ornament_id = 3 &amp; size_id = 1
  ornament_id = 3 &amp; size_id = 2 
  ornament_id = 3 &amp; size_id = 3
  </code></pre>
  
  <p>I just want to know what the method would be not the actual code</p>