<?php
$con = mysqli_connect("localhost","root","","student");
$page = 1 ;
if(isset($_POST['search'])){
$page = 2;
$id = $_POST['id'];
$sql = "select * from addmission_info where id = $id" ;
$res = mysqli_fetch_assoc(mysqli_query($con , $sql));
}
if(isset($_POST['update'])) {
$a =$_POST['name'];
$b=$_POST['fname'];
$c=$_POST['mname'];
$d=$_POST['date'];
$e=$_POST['class'];
$f=$_POST['fee'];
$g=$_POST['address'];
$k="update addmission_info set name='$a',f_name='$b',m_name='$c', A_date='$d', class='$e', addmission_fee='$f', address='$g' where id='$d' ";
$res= mysqli_query($con,$k);
$page = 3;
}
?>
<!DOCTYPE html>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<?php
if($page == 1)
{
?>
<form action="" method="post">
<input type="number" name="id" placeholder="enter your id">
<input type="submit" name="search" value="search">
<?php
}
else if($page==2){
?>
<form action="" method="post">
<td> <input type="number" name="sid" value="<?php echo $res['id']?>" >
</td>
<td><input type="text" name="name" value="<?php echo $res['name']?>">
</td>
<td> Your Father name
</td>
<td><input type="text" name="fname" value="<?php echo $res['f_name']?>">
</td>
<td> Your Mother name
</td>
<td><input type="text" name="mname" value="<?php echo $res['m_name']?>">
</td>
<td> Addmission date
</td>
<td><input type="date" name="date" value="<?php echo $res['A_date']?>">
</td>
<td><input type="number" name="class" value="<?php echo $res['class']?>">
</td>
<td> Your addmission fee
</td>
<td><input type="number" name="fee" value="<?php echo $res['addmission_fee']?>">
</td>
<td><input type="text" name="address" value="<?php echo $res['address']?>">
</td>
<td><input type="submit" value="update" name="update"></td>
<?php
}
else{
if($res)
{
echo "update secss";
}
else
echo"not secss";
}
?>
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}