I have it now selecting from the db, but i want the person to be able to input a customer id number e.g. 7 and the following page have customer 7's details appear and you can update them.
//update
<html>
<head>
<title>Update</title>
</head>
<body bgcolor="white">
<form method="POST" action="update1.php">
<table>
<col span="1" align="right">
<tr>
<td><font color="blue">Customer ID:</font></td>
<td><input type="text" name="customerid" size=10></td>
</tr>
<tr>
<td><input type="submit" value="Submit"></td>
</tr>
</table>
</form>
</body>
</html>
//update 1
<?php
$sqlstr = mysql_query("SELECT * FROM customers WHERE customerid = '.$id;"
;
$amount_of_rows = mysql_num_rows($sqlstr); ?>
<?php
if ($amount_of_rows > 0);
{
while ($row = mysql_fetch_array($sqlstr)) {
?>
<html>
<head>
<title>Update</title>
</head>
<body bgcolor="white">
<form method="post" action="update2.php">
<table>
<col span="1" align="right">
<tr>
<td><font color="blue">Customer Name:</font></td>
<td><input type="text" name="name"
value="<?php echo $row["name"]; ?>" size=100></td>
</tr>
<tr>
<td><font color="blue">Customer Address:</font></td>
<td><input type="text" name="address"
value="<?php echo $row["address"]; ?>" size=100></td>
</tr>
<tr>
<td><font color="blue">Telephone number:</font></td>
<td><input type="text" name="telephoneno"
value="<?php echo $row["telephoneno"]; ?>" size=100></td>
</tr>
<tr>
<td><font color="blue">House Type:</font></td>
<td><input type="text" name="housetype"
value="<?php echo $row["housetype"]; ?>" size=100></td>
</tr>
<tr>
<td><font color="blue">Date:</font></td>
<td><input type="text" name="date"
value="<?php echo $row["date"]; ?>" size=100></td>
</tr>
<tr>
<td><font color="blue">Customer ID:</font></td>
<td><input type="text" name="customerid"
value="<?php echo $row["customerid"]; ?>" size=100></td>
</tr>
<tr>
<td><input type="submit" value="Submit"></td>
</tr>
<?php
}
}
?>
//update 2
<?php include 'config.php'; ?>
<?php
$formVars[$varname]=$value;
$name=$formVars['name'];
$address=$formVars['address'];
$telephoneno=$formVars['telephoneno'];
$housetype=$formVars['housetype'];
$phone=$formVars['phone'];
$customerid=$formVars['customerid'];
$query="UPDATE customers SET name ='$name', address='$address', telephoneno='$telephoneno', housetype ='$housetype', phone ='$phone' WHERE customerid ='$customerid' ";
mysql_query($query);
mysql_close($con);
?>
</body>
</html>