PHP Example
Screen shot
PHP Script to fetch record from database (save file as index.php)

<?php
$con=mysql_connect('localhost','root','') or die("Mysql not connect");
$database=mysql_select_db('test',$con) or die("not connected");
?>
<html>
<head>
<title>Fetch record from dataBase</title>
</head>
<body>
<?php
$query="select * from info";
$result=mysql_query($query);
?>
<table border='0'>
<tr bgcolor="#00CCCC">
<td>Username</td>
<td>Email ID</td>
<td>Country</td>
</tr>
<?php
while($data=mysql_fetch_array($result))
{
?>
<tr bgcolor="#B4F7FA">
<td><?php echo $data['username']; ?></td>
<td><?php echo $data['email_id']; ?></td>
<td><?php echo $data['country']; ?></td>
</tr>
<?php
}
?>
</table>
</body>
</html>

You can download source code here