how to create edit form .and update user data my table is;

id int auto_increment
Status (set)

My view table code is ;-


//connects to database
$con = mysql_connect("localhost","root",""); 
if (!$con) 
  die('Could not connect: ' . mysql_error()); 

mysql_select_db("users", $con); 

//select table
$select = mysql_query("SELECT * FROM entryform") or die('No table exist!');
$numrows = mysql_num_rows($select);

        echo <<<EOM
                <table border='1'>
                        <th>Complaint No.</th>
                        <th> Name</th>
                        <th>Ext no.</th>
                        <th>IP Add</th>

while ($row = mysql_fetch_assoc($select))
        echo <<<EOM
                        <td><a href='edit.php'>Edit</a>  <a href='delete.php'>Delete</a></td>



        echo <<<EOTABLE




<a href='edit.php'>Edit</a>

First you will have to tell edit.php which user you want to edit, so change this to:

<a href='edit.php?id={$row['id']}'>Edit</a>

Now you can use $_GET['id'] in your edit script to retrieve the details.

here is my edit.php code but data not updated.please correct the code..

error message in page

Notice: Undefined variable: submit in edit.php on line 68

Notice: Undefined index: in edit.php on line 68

//change user and password to your mySQL name and password

//connect to mysql
//change user and password to your mySQL name and password
mysql_connect("localhost", "root", "");

//select which database you want to edit

     $result = mysql_query("select * from entryform order by id"); 



      echo "";
    // echo "<a href='edit.php?id=edit&id=$id'>Edit - $id $Name $Department $Problem $Ext_no $Ip_Add $Remark $Email $Status</a>";
      echo "";
   if (!isset($_POST["submit"]))
      $id = $_GET["id"];
      $sql = "SELECT * FROM entryform WHERE id=$id";
      $result = mysql_query($sql);        
      $row = mysql_fetch_array($result);

      <form action="edit.php" method="post"  >
      <input type=hidden name="id" value="<?php echo $row["id"] ?>">

Name:<input type="text" name="make" value="<?php echo $row["Name"] ?>" size=30 /><br />
     Department:<input type="text" name="Department" value="<?php echo $row["Department"] ?>" size=30 /><br />
      Problem:<input type="text" NAME="Problem" value="<?php echo $row["Problem"] ?>" size=30 /><br />
      Ext no:<input type="text" NAME="Ext no" value="<?php echo $row["Ext_no"] ?>" size=30 /><br />
      Ip Add:<input type="text" NAME="Ip Add" value="<?php echo $row["Ip_Add"] ?>" size=30 /><br />
      Remark:<input type="text" NAME="Remark" value="<?php echo $row["Remark"] ?>" size=30 /><br />
      Email:<input type="text" NAME="Email" value="<?php echo $row["Email"] ?>" size=30 /><br />
     Status:<input type="text" NAME=" Status" value="<?php echo $row["status"] ?>" size=30 /><br />

      <input type="hidden" name="cmd" value="edit" />

      <input type="submit" name="submit" value="submit" />       


   if ($_POST["$submit"])
      $Name = $_POST["Name"];
      $Department = $_POST["Department"];
      $Problem = $_POST["Problem"];
      $Ext_no = $_POST["Ext_no"];
      $Ip_Add = $_POST["Ip_Add"];
      $Remark = $_POST["Remark"];
      $Email = $_POST["Email"];
      $Status = $_POST["status"];         

      $sql = "UPDATE entryform SET Name='$Name',Department='$Department',Problem='$Problem',Ext_no='$Ext_no',Ip_Add='$Ip_Add',Remark='$Remark,Email='$Email,status='$status' WHERE id=$id";       
      $result = mysql_query($sql);
      echo "Thank you! Information updated.";       }


See if you get an error:

$result = mysql_query($sql) or die(mysql_error());