<?

$name = $_POST['name'];
$age = $_POST['age'];
$ID = $_POST['ID'];


// script to display all the records in a table

// connection information
$hostName = "servername";
$userName = "username";
$password = "password";
$dbName = "dbname";

// make connection to database
mysql_connect($hostName, $userName, $password) or die( "Unable to connect to host $hostName");

mysql_select_db($dbName) or die("Unable to select database $dbName");

// Update the records in table1

$query = "UPDATE table1 SET name = '$name', age = '$age' WHERE ID = '$ID'";
$result = mysql_query($query);

// Close the database connection
mysql_close();

header("Location: display.php");
?>