View Particular Record Using PHP Mysqli

<?php
if(isset($_GET['id']))
{
 $con = mysqli_connect('localhost','root','root','example') or die(mysqli_error());
          $query= mysqli_query($con,"select * from student_info where id={$_GET['id']}") ;
         // $result = mysqli_query($con,$query);
          $row = mysqli_fetch_array($query);


?>
<?php
}
?>
   
   
    <h3 align="center">Student Information</h3>
 
  <table align="center" border="1" >
  <tr>
  <td>Name</td>          
   <td><input type="text" name="name" value="<?php echo $row['name']?>" readonly> </td>
</tr>


<tr>
  <td>Email</td>          
   <td><input type="text" name="email" value="<?php echo $row['email']?>" readonly></td>
  </tr>
 
   <tr>
  <td>Address</td>
  <td><textarea name="address" cols="16"><?php echo $row['address']; ?></textarea></td>        

 </tr>
 
 
   <tr>
  <td>Mobile no.</td>      
   <td> <input type="text"  name="department" value="<?php echo $row['m_no']?>" readonly></td>
   </tr>
 
   



</table>
Previous
Next Post »