How do I select some items from a dimanic table coming from the mysql database and loaded into a table using javascript or jquery and set the marked checkboxes to the category as 'sport' in the database? Below is an outline of the code
<table border="1">
<thead>
<tr>
<th>Id</th>
<th>Nome</th>
<th>Categoria</th>
<th>Editar</th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="checkbox" id="<?php echo $id ?>" value="<?php echo $id ?>"></td>
<td>Fifa 2017</td>
<td>Não definido</td>
<td><button name="Editar">Editar</button></td>
</tr>
<tr>
<td><input type="checkbox" id="<?php echo $id ?>" value="<?php echo $id ?>"></td>
<td>Formula 1</td>
<td>não definido</td>
<td><button name="Editar">Editar</button></td>
</tr>
</tbody>
</table>
In the example above I want to select the two items and edit them so that the category is a sport.
I think of retrieving the ids of the selected checkboxes and writing to an Array () and then picking up this Array () and updating the database with the data.
I need to select multiple and edit only once and not line by line.