Hey everyone,
I created a very simple MySQL database that houses a flat file table with less than 10 fields. I am able to add and remove contacts, as well as search for them. Once I made a mistake in adding a contact I realized that I needed to edit contacts as well.
So I pieced together these three pages to try and get the job done. When I go through the editing process, it appears that everything worked. But when I check the database the contact is not receiving the edit. I think it might have something to do with the query ran in postupdate.php?
The database name is “nanette_database”, username is “nanette_database”, and the table is “people”.
Update.html
<!DOCTYPE html>
<html lang="en">
<html>
<head>
<meta charset="utf - 8">
<title>Select Contact to Edit</title>
<script src="modernizr.min.js"></script>
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> For Internet Explorer error detection
<![endif]-->
</head>
<body>
<body bgcolor="white">
<form method="POST" action="update.php">
<table>
<col span="1" align="right">
<tr>
<td>Enter User Id to Update:</td>
<td><input type="text" name="id" size=50></td>
</tr>
<tr>
<td><input type="submit" value="Submit"></td>
</tr>
</table>
</form>
</body>
</html>
Update.php
[php]
<meta charset="utf - 8">
<title>Edit Contact</title>
<script src="modernizr.min.js"></script>
<!--[if lt IE 9]>
For Internet Explorer error detection
<![endif]–>
Industry: | Marine Plastics Oil Food Oem Transporation Energy Water Packaging Automotive Telecom Construction Electrical Defense value="<? echo $formVars["industry"]; ?>">|
Publication: | " size=100> |
Editor: | " size=100> |
Website: | " size=100> |
Email: | " size=100> |
Phone: | " size=100> |
Notes: | " size=100> |
id: | " size=100> |