Update Form. Update old details with new details from same
Posted: Wed Jan 13, 2010 1:59 pm
I am sorry for the starter question but its something I have been pulling my hair out with all day now. I have a simple database setup. Its an assignment and not a real world application. I have created forms to put data into the database, I have forms to delete data from the database and they were not too bad for me to make and to an extent understand. I really struggle with programming its not my strong point and probably never will be but I do have a slight desire to learn php and MySql. Anyway enough waffle and onto the problem.
I have a form that has 5 text fields for a CustomerID, CustomerSurname, CustomerFirstName, CustomerAddress and CustomerTelephoneNumber. under the heading of old customer details. Then below that on the same form under the heading Enter the new customer details, I have the same text fields in which to enter the new customers details. So what I need to do with the php code is take those old details that have been entered in the text fields and update them in the database with the details entered in the second lot of text fields that are under the new customer details heading. So what I imagine to happen is the program looks at the form say right old customer details are here, lets update in the MySql database those old details with the second lot of details on this form.
The code for the form looks like
I hope this makes sense. Thank you for any help.
.
I have a form that has 5 text fields for a CustomerID, CustomerSurname, CustomerFirstName, CustomerAddress and CustomerTelephoneNumber. under the heading of old customer details. Then below that on the same form under the heading Enter the new customer details, I have the same text fields in which to enter the new customers details. So what I need to do with the php code is take those old details that have been entered in the text fields and update them in the database with the details entered in the second lot of text fields that are under the new customer details heading. So what I imagine to happen is the program looks at the form say right old customer details are here, lets update in the MySql database those old details with the second lot of details on this form.
The code for the form looks like
Code: Select all
<html>
<head>
<title> Industial Fasteners </title>
</head>
<body>
<h1> Update Customer Details Form </hl>
<h2> Please enter the customers old details</h2>
<form action="Update.php" method="post">
<table>
<tr>
<td>CustomerNumber:
<td><input type="text" name="CustomerNumber" />
</tr>
<tr>
<td>CustomerSurname:
<td><input type="text" name="CustomerSurname" />
</tr>
<tr>
<td>CustomerFirstName:
<td><input type="text" name="CustomerFirstName" />
</tr>
<tr>
<td>CustomerAddress:
<td><input type="text" name="CustomerAddress" />
</tr>
<tr>
<td>CustomerTelephoneNumber:
<td><input type="text" name="CustomerTelephoneNumber" />
</tr>
</table>
<h2> Please enter the new customer details</h2>
<form action="Update.php" method="post">
<table>
<tr>
<td>CustomerNumber:
<td><input type="text" name="CustomerNumber" />
</tr>
<tr>
<td>CustomerSurname:
<td><input type="text" name="CustomerSurname" />
</tr>
<tr>
<td>CustomerFirstName:
<td><input type="text" name="CustomerFirstName" />
</tr>
<tr>
<td>CustomerAddress:
<td><input type="text" name="CustomerAddress" />
</tr>
<tr>
<td>CustomerTelephoneNumber:
<td><input type="text" name="CustomerTelephoneNumber" />
</tr>
</table>
</form>
</body>
</html>.