display.php
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table border="1" align="center">
<tr>
<td>Id</td><td>Name</td><td>City</td><td>Pincode</td>
</tr>
<?php
$con=mysql_connect("localhost","root","");
mysql_select_db("test");
$sql="select * from stud";
$nsql=mysql_query($sql);
while($row=mysql_fetch_array($nsql))
{
?>
<tr>
<td><?php echo $row[0]; ?></td>
<td><?php echo $row[1]; ?></td>
<td><?php echo $row[2]; ?></td>
<td><?php echo $row[3]; ?></td>
</tr>
<?php
}
?>
</table>
</body>
</html>
0 Comments: