Couple of other things worth mentioning:
Firstly, if all you want to do is pass the id to the next page, then in effect you only need to fetch the id from the database, not the complete result set. Once you pass the id to the next page, do another query based on that id to fetch the data. To pass all the data to the next page, you need to either store all the info in a query string or use a form with hidden form fields.
Secondly, as you are using mysql_fetch_array, which fetches the results set as an associative array, you should use the table names. mysql_fetch_row uses an enumerated array.
mysql_fetch_array = associative array
while ($r = mysql_fetch_array($result)) {
$ID= $r["id"];
$name = $r["name"];
$last= $r["last"];
$email= $r["email"];
}
mysql_fetch_row - enumerated array
while ($r = mysql_fetch_row($result)) {
$ID= $r[0];
$name = $r[1];
$last= $r[2];
$email= $r[3]; }
you can also use mysql_fetch_object, which fetches the results as an object set
while ($r = mysql_fetch_object($result)) {
$ID -> id;
$name -> name;
$last -> last;
$email -> email;
}
Hope that helps.