Several "clues" here.. 😉
Ok.. I'm sure your add query looks something like this...
$query="INSERT INTO table (FIELD1,FIELD2,ETC) VALUES ('FIELD1','FIELD2','ETC')";
Assuming that's true, you'll first need to retrieve the info from the db and populate some sort of HTML page with the information to be edited... You can use your original HTML form even (where the info was submitted in the first place). Just add "value=\"$phpvalue\" to your input boxes to give them the "original" value. In example, if you extract a first and last name from the database and store them in $first and $last, respectively, as well as a unique ID number (probably your primary key you use in the db would be a good choice) your "new" HTML output would look something like this...
<?php
// Misc code - HTML headers - Form header, etc here
echo "<INPUT TYPE=\"TEXT\" NAME=\"f_name\" VALUE=\"$first\">
<INPUT TYPE=\"TEXT\" NAME=\"l_name\" VALUE=\"$last\">
<INPUT TYPE=\"HIDDEN\" NAME=\"uniqueid\"VALUE=\"$uniqueid\">";
// Submit button, </FORM> tag, etc...
?>
Now, when this form is submitted you want to call an update user script as opposed to an add user script. Your query would look something like this...
$query="UPDATE usertable SET FirstName='$first', LastName='$last' WHERE UserID=$uniqueid";
I think that's right =)
Anyway, that's a start. Also a note / disclaimer. The above script is NOT secure, as a user could, depending on your setup / security precautions, randomly start changing info by passing it in the URL to your update program... so be careful. And for those wondering how...
http://host.com/updateuser.php?uniqueid=34&first=Billy&last=Bob
would update userid 34's first and last name to "Billy" and "Bob"... so again, be careful