Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

Editing date

$
0
0

After clicking edit link(see one.jpg), it is going to edit_form.php(see oneone.jpg .jpg) and taking ID also but NOT displaying anything in my textfields.

PLEASE HELP ME OUT...

 

main code in edit.php:

 

                                       echo ("<td><a href=\"edit_form.php?number=$row[ID]\">Edit</a></td></tr>");

edit_form.php:

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 
 
<html>
 
<head>
 
<title>Form Edit Data</title>
 
</head>
 
<body>
 
<table border="1">
  <tr>
 
    <td align=center>Form Edit Employees Data</td>
 
  </tr>
 
  <tr>
 
    <td>
 
      <table>
 
      <?php
error_reporting(0);
// Connect to the database
$con = mysql_connect("localhost","admin","");
// Make sure we connected succesfully
if(! $con)
{
die('Connection Failed'.mysql_error());
}
 
// Select the database to use
mysql_select_db("test",$con);
 
$order = "SELECT * FROM budget where ID= '$number' ";
 
      $result = mysql_query($order);
      $row = mysql_fetch_array($result);
 
      ?>
 
      <form method="post" action="edit_data.php">
<input type="hidden" name="ID" value="<?php echo "$row[ID]" ?>">
 
     
 
        <tr>        
 
          <td>AMOUNT</td>
 
          <td>
 
            <input type="text" name="amount"
 
        size="20" value="<?php echo "$row[AMOUNT]"?>">
 
          </td>
 
        </tr>
 
        <tr>
 
          <td>PUPOSE</td>
 
          <td>
 
            <input type="text" name="purpose" size="40"
 
          value="<?php echo "$row[PURPOSE]"?>">
 
          </td>
 
        </tr>
<tr>
 
          <td>DATE</td>
 
          <td>
 
            <input type="text" name="date" size="40"
 
          value="<?php echo "$row[DATE]"?>">
 
          </td>
 
        </tr>
<tr>        
 
          <td>NAME</td>
 
          <td>
 
            <input type="text" name="name"
 
        size="20" value=" <?php echo "$row[NAME]"?> ">
 
          </td>
 
        </tr>
        
        <tr>
 
          <td align="right">
 
            <input type="submit"
 
          name="submit value" value="Edit">
 
          </td>
 
        </tr>
 
      </form>
 
      </table>
 
   </td>
 
 </tr>
 
</table>
 
</body>
 
</html>
 

Viewing all articles
Browse latest Browse all 13200

Trending Articles