<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<a href="showinfo.php">Show Information</a>
<br/>
<?php
//step 1 = connect to the server
$con = mysql_connect("localhost:3306" ,"root", "");
//step 2 = select the datebase
mysql_select_db("dvdclub", $con);
//step 3 = execute the query
$result = mysql_query("select * from customers");
?>
<table border="1">
<tr>
<th>ID</th>
<th>First Name</th>
<th>Last Name</th>
</tr>
<?php
while ($row = mysql_fetch_array($result))
{
?>
<tr>
<td><?php echo $row["id"]?></td>
<td><?php echo $row["FirstName"]?></td>
<td><?php echo $row["LastName"]?></td>
</tr>
<?php
}
?>
</table>
<?php
//step 4 = close the connection
mysql_close($con);
?>
</body>
</html>
No comments
Post a Comment