0
I have an editable table in html, when clicking save, I need to take all the data of the table, send by ajax to the page that makes the INSERT of all the lines in the database.
My doubt would be:
- How to grab all rows from the table and send via ajax.
- How to insert all these lines, since they can be 5, 6 or more lines. Never a fixed value.
Structure of the HTML table
<tbody class="list_modificacao"><tr>
<th scope="row">JOAO</th>
<td class="text-center option_divisao bg-dark luz">-</td>
<td class="text-center option_divisao bg-dark agua">-</td>
<td class="text-center option_divisao bg-dark agua_campo">-</td>
</tr><tr>
<th scope="row">MARIA</th>
<td class="text-center option_divisao bg-dark luz">-</td>
<td class="text-center option_divisao bg-dark agua">-</td>
<td class="text-center option_divisao bg-dark agua_campo">-</td>
</tr><tr>
<th scope="row">JOSE</th>
<td class="text-center option_divisao bg-dark luz">-</td>
<td class="text-center option_divisao bg-dark agua">-</td>
<td class="text-center option_divisao bg-dark agua_campo">-</td>
</tr>
</tbody>
BD structure
+------+-----+------+------------+
| NOME | LUZ | AGUA | AGUA_CAMPO |
+------+-----+------+------------+