get record from database in textfield with php

<html>
<body>
<?php

$a=$_GET['uid'];
echo "$a";
$con=mysql_connect("localhost","root","root");
if(!con)
{
die("could not connect".mysql_error());
}
$sql="select * from department where id='".$a."'";
mysql_select_db('naveen',$con);
echo "naveen";
$qry = mysql_query( $sql);
echo "<table border='2'>";
echo "<form action='update.php' method='POST'>";
echo "naveen";
while($r=mysql_fetch_array($qry))
{
 $id=$r["id"];
 $name=$r["name"];
 $pass=$r["password"];
 $mail=$r["emailid"];
echo "<tr>";
echo "<td><input type='hidden' name='i' value='".$id."'/></td><br/>";
echo "<td><input type='text' value='".$name."' name='n'/></td><br/>";
echo "<td><input type='text' value='".$pass."' name='p'/></td><br/>";
echo "<td><input type='text' value='".$mail."' name='e'/></td><br/>";
echo "</tr>";
echo "<tr>";
echo "<td><input type='submit' value='update'/></td>";
echo "</tr>";
}
echo "</form>";
echo "</table>";

?>
</body>
</html>

Popular posts from this blog

Simple Sign up design. Android.

Cart page design in android.

Set Date on jDateChooser and retrieve record from database.