I'm making a small site that stores info that you submit. Right now I can add info and delete info from the database. Now I'm trying to make a script where you can edit all the fields in a row at once.
Here is how I add data that I get from a form:
$query = "INSERT INTO ea(org, pos, ele, lev, fr, so, jr, sr, userid)
VALUES('".$POST['org']."','".$POST['pos']."','".$POST['ele']."','".$POST['lev']."','".$POST['fr']."','".$POST['so']."','".$POST['jr']."','".$POST['sr']."','".$_GET['userid']."')";
$result = mysql_query($query);
Here is what I think will work when trying to update it, but I'm hesistant to try it:
$query = "UPDATE ea WHERE ID=$id(org, pos, ele, lev, fr, so, jr, sr)
VALUES('".$POST['org']."','".$POST['pos']."','".$POST['ele']."','".$POST['lev']."','".$POST['fr']."','".$POST['so']."','".$POST['jr']."','".$POST['sr']."')";
$result = mysql_query($query);
ID is just the name of the row, and the link to the edit will provide what row(ID) number I need to edit. Will this just simply replace all the values in the given row? I couldn't find any good examples on how to update more than one record at a time.
Thanks, btw I don't know how to format PHP code on this forum yet.