Forum Moderators: phranque
<html>
<body>
<head><title>Database<title></head>
<table>
<tr>
<td>Name</td> <td>Address</td> <td> Age</td>
</tr>
<?
$conn = mysql_connect ("localhost", "root","")
or die("Could not connect to localhost");
mysql_select_db("profile", $conn) // profile is the name of your DB
or die("Could not select database");
$ConQuery = "select * from person"; //person is the name of your table
$result = mysql_query($ConQuery) // $result holds the results of the query
or die(mysql_error());
$number_cols = mysql_num_fields($result);
while ($AdeSelectionRow = mysql_fetch_array($result, MYSQL_NUM))
{
echo "<tr><td>$AdeSelectionRow[0] </td> <td>$AdeSelectionRow[1] </td> <td>$AdeSelectionRow[2]</td></tr>";
}
echo "</table>";
?>
</body>
</html>