I have a database/php app set up that allows a user to input and record data by way of checkboxes. The entry for the HTML code is as follows:
<td width=142><p><input type="checkbox" name="model[]" value="1">Ford</td>
<td width=142><p><input type="checkbox" name="model[]" value="2">Ferrari</td>
<td width=142><p><input type="checkbox" name="model[]" value="3">Dodge</tr>
<td width=142><p><input type="checkbox" name="model[]" value="4">Porsche</td>
<td width=142><p><input type="checkbox" name="model[]" value="5">BMW</td>
<td width=142><p><input type="checkbox" name="model[]" value="6">GM</tr>
<td width=142><p><input type="checkbox" name="model[]" value="7">Fiat</td>
<td width=142><p><input type="checkbox" name="model[]" value="12">VW</td>
<td width=142><p><input type="checkbox" name="model[]" value="8">Lambo</tr>
<td width=142><p><input type="checkbox" name="model[]" value="9">Seat</td>
<td width=142><p><input type="checkbox" name="model[]" value="10">Saab</td>
If the user were to have checked Ford and BMW, the values 1 and 5 would have been input into a database (2 separate records in the db) containing the user's ID and the values 1 & 5, indicating this user likes Ford and BMW.
The problem I am facing is that the user changed his mind and now likes Ferraris also. How can I pull the existing tagged data (1, 5) and provide an update page with Ford & BMW selected, but the other options also available, so that the records can be brought current? Does this involve two separate queries? How does this get merged, so that after doing an "update" command, the database now has (5, 2) (the guy changed his mind about Ford).