<html>
<body bgcolor="gray">
<center>
<table style="width:80%; background-color:yellow;" border="5">
<th>Roll No</th>
<th>Name</th>
<th>Course</th>
<?php
$host="localhost";
$dbuser = "root";
$password = ""; // change password as per your database.
$dbname= "sharp_tutorial";
$conn = mysqli_connect($host, $dbuser, $password,$dbname);
$query=" select * from student ";
$data=mysqli_query($conn,$query);
if(mysqli_num_rows($data) > 0) {
while($row= mysqli_fetch_assoc($data)) {
echo"<tr>";
echo "<td>". $row['rollNo']. "</td>";
echo "<td>". $row['sname']. "</td>";
echo "<td>". $row['course']. "</td>";
echo"</tr>";
}
}
?>
</table>
<center></body>
</html>