I have the following columns in the mysql:
firstname, lastname,age,email,phone
When I update say I have the following:
John Doe 23 eee@yahoo.com 5555555555
but when I want to edit any of the fields and I submit it comes out to:
Mike 0 
and thats it. Any Ideas?
Heres my edit.php
<html>
<body>
<table>
<?php
include 'db.inc.php';
// Connect to MySQL DBMS
if (!($connect = @ mysql_connect($hostName, $username,
  $password))){
  showerror();
 }
// Use the food database
if (!mysql_select_db($databaseName, $connect)){
  showerror();
}
$uid=$_GET[id];
$query=mysql_query("SELECT * FROM contact WHERE id='$uid'");
$row=mysql_fetch_array($query); 
?>
<form method ="post" action="update.php">
<table>
<tr>
<td><input type="hidden" name="id" value="<?php echo "$row[id]"?>"></td>
</tr>
<tr>
<td>First Name:</td>
<td><input type="text" name="ud_firstname" value="<?php echo          "$row[ud_firstname]"?>"></td>
</tr>
<tr>
<td>Last Name:</td>
<td><input type="text" name="ud_lastname" value="<?php echo"$row[ud_lastname]"?>"></td>
</tr>
<tr>
<td>Age:</td>
<td><input type="text" name="age" value="<?php echo"$row[ud_age]"?>"></td>
</tr>
<tr>
<td>Email:</td>
<td><input type="text" name="email" value="<?php echo "$row[ud_email]" ?>">    </td>
</tr>
<tr>
<td>Phone Number:</td>
<td><input type="text" name="phone" value="<?php echo "$row[ud_phone]" ?>">  </td>
</tr>
<input type = "submit">
</table>
</form>
</body>
</html>
and then this is my update.php
 include 'db.inc.php';
 // Connect to MySQL DBMS
if (!($connect = @ mysql_connect($hostName, $username,
  $password))){
  showerror();
  }
 
if (!mysql_select_db($databaseName, $connect)){
  showerror();
 }
 $uid =$_POST["id"];
 $ud_firstname = mysql_real_escape_string($_POST["ud_firstname"]);
 $ud_lastnamename = mysql_real_escape_string($_POST["ud_lastname"]);
 $ud_age = mysql_real_escape_string($_POST["ud_age"]);
 $ud_email = mysql_real_escape_string($_POST["ud_email"]);
 $ud_phone = mysql_real_escape_string($_POST["ud_phone"]);
 mysql_query("UPDATE contact
    SET firstname = '$ud_firstname', lastname = '$ud_lastname', age =    '$ud_age', email='$ud_email', phone='$ud_phone'
     WHERE id=$uid");
if(mysql_affected_rows()>=1){
echo "<p>($id) Record Updated<p>";
header('location:view.php');
}else{
    echo "<p>($id) Not Updated<p>";
}
?>
Any ideas?
 
     
    