Practical 23 : Write a PHP program for display all record from the database
<html>
<head>
<title>Practical : 23</title>
</head>
<body>
<?php
mysql_connect("localhost","root","");
mysql_select_db("Class_DB");
$sql="select * from Student";
$result=mysql_query($sql);
?>
<center>
<form name="f1" method="post">
<table border="1px">
<tr>
<th>Sno</th>
<th>Student Name</th>
<th>Address</th>
</tr>
<?php
while($row=mysql_fetch_array($result))
{
?>
<tr>
<td><?php echo $row[0]; ?> </td>
<td><?php echo $row[1]; ?> </td>
<td><?php echo $row[2]; ?> </td>
</tr>
<?php
}
?>
</table>
</center>
</form>
</body>
</html>

EmoticonEmoticon