I'm trying to allow users to add new records and update existing fields in a MySQL database using a PHP form.
I've built the form and users can add new records, but when I modify the $add function to use UPDATE instead of INSERT INTO, it uses the values that have been entered into the form to update all of the records instead of just the one that has been edited.
The full code is here: http://pastebin.com/s0TBUYgK
The UPDATE query that I've tried to replace the INSERT INTO query on line 20 with is:
$add = "UPDATE albums SET name = '$name', artist = '$artist', year = '$year'";