wow. that post got completely ruined by the forum somehow. luckily i copied it first:
ok, let's do this:
I'm not sure which row is the meat of the data, but you said you have ID field. I am implying that your ID field is an auto-incrementing integer, which does no good in identifying it from a stand-alone page. Let us augment the ID field as I've described, and give the row ID a name. So your insert query would be like such
" INSERT INTO 'mytable' (IDname, due_ge, due_rk, due_ny) VALUES ( ...);
Naming the ID allows us to have a singular page where you can update from.
On your edit page, I would put a dropdown menu that can have an option for each row.
<?php
include ('connection.php');
echo'
<form method="POST" name="due_update" action="due_update.php">
<select name="IDname">
$list = mysql_query("SELECT * FROM 'mytable' ")
while($row = mysql_fetch_array($list)){
echo '<option value="'.$row['IDname'].'">'.$row['IDname'].'</option></select>';
echo '<input type="text" name="'.$row['due_ge'].'" value="'.$row['due_ge'].'" />
<input type="text" name="'.$row['due_rk'].'" value="'.$row['due_rk'].'" />
<input type="text" name="'.$row['due_ny'].'" value="'.$row['due_ny'].'" />';
}
echo '<input type="submit" value="Update!" />';
What this should do is populate a dropdown menu given by the ID of the row (so it can be identified), then auto-fill the text boxes with the values. So all you have to do is update what you want to, then hit submit.
Tip: You should move your connection information to standalone php file so you can just call on it instead of repeating it. (that's the file i included at the top).
From there, all you need to do is write the update script which basically consists of:
<?php
include('connection.php');
mysql_query("UPDATE mytable SET due_re = '$_POST['due_re']' AND due_rk = '$_POST['due_rk'] AND due_ny = '$_POST['due_ny'] WHERE IDname = '$_POST['IDname'] ");
header("Location: xxx");
?>
Where location is where u wanna go after the script is compiled, or omit it and echo out some verifications or what not. Be advise, this code is pretty generic and shouldn't be used exactly as is, but should work to give you a feel for what's going on.