title: Updating Dynamic Form Fields in MySQL Database
body: <p>I have created a form that allows users to dynamically add as many fields as needed. Each of these is an inventory item that is assigned to a device. I have 3 tables, the Devices, the Inventory Items, and the third to associate the Device with an inventory item.</p>
  
  <p>When the user saves the form, it is possible that they may have removed existing entries, added new ones or left some unchanged. The best way I can think to handle this is to empty all Table rows that associate that device with an item and rewrite them based on the input from the form. </p>
  
  <p>Would there be a more efficient way of doing this? I can't imagine that dumping all rows and then rewriting them is the most viable option.</p>