Lets say I have a form with 3 checkboxes (valued 1, 2, 3 respectively along with today's date). On this form I have a save/submit button to save the inputted values into mysql database.
Once saved, I redisplay those checkboxes to the user by checking to see if they are checked within the database, if so, then I simply give them a "checked" status. Thus the user see's their saved values for those checkboxes.
All that is working fine. Now, I wish to see if the user:
a) hits the save button without changing anything, if so then just skip manipulating the database. This currently does not work because my form simply re-adds those fields just saved to the database. Hence a user can continue to add identical rows into my database. What code/theory should I use to check to see if identical data already exisits, if so just skip?
b) unchecks a field then saves the form again. If a value was previously saved, but now the user unchecks that checkbox. What code/theory should I use to remove that previously checked checkbox in the database? DEL FROM users WHERE chk = 'val';?
Any help would be much appreciated.