I need to write multiple records at once in MySQL for example.
I have the PRODUTOS
, CATEGORIAS
tables and a third table that lists the two and also a form where I select the category and mark all the checkboxes of the products that will be inserted in that category, I need each marked checkbox to become a record in the table so I can have 'N' records at the same time.
The record in the third table would look like this:
ID: 1 | Categoria: 1 | Produto: 1
ID: 2 | Categoria: 1 | Produto: 2
ID: 3 | Categoria: 1 | Produto: 3
ID: 4 | Categoria: 1 | Produto: 4
Since each product entered was a checked checkbox and the product is related to category 1 (1 = Category ID)