Mark, the first thing you want to do your edit page is create the update code block within an if statement:
if ($updatedata) {
$update = "UPDATE table SET
column1 = '$var1',
column2 = '$var2'
where column='value'";
mysql_query($update);
}
$var1, $var2, and $updatedata will be set further down the page from an HTML form you are going to create.
The next thing you want to do in your edit page is pull the info from the database:
$query = "SELECT * FROM table WHERE column='value'";
You'll have to use mysql_fetch_array() in a while loop to gain access to the data in the columns:
while ($data = mysql_fetch_array($query)) {
var1 = $data[column1];
var2 = $data[column2];
}
Technically, you don't have to run that while loop, you could just do this:
$data = mysql_fetch_array($query)
and then refer to the elements of the $data array to get the data, but I find the code is cleaner by using the loop above.
Finally, after that create an HTML form with the action being <?php echo $PHP_SELF ?> and with a text field representing each column from the database that you want the admin to be able to edit. Each text field would look something like this:
<input type=text name=columnname value="<?php echo $var1 ?>">
with the appropriate var being substituted for $var1.
Make a submit button and name it updatedata. This will determine whether the update portion of the script runs or not based on whether this button is clicked.
The result of all this will be an HTML form that will have the data from each column of the database in each corresponding field of the form. The data in the form can be altered, then the update button can be clicked which will trigger the update script. Since the update script is first in the script, the update will happen before the form reloads, so when it does reload, you will have all the updated data. Be sure to do any error handling and successful update notification that you deem necessary.
Hope this helps and I hope I wasn't going over stuff that you already know how to do. If you need clarification or help debugging on this, let me know.