note 111238 deleted from mysql.examples by philip
| From: | philip@php.net | Date: | Wed, 30 Jan 2013 23:59:06 +0000 |
| Subject: | note 111238 deleted from mysql.examples by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-193457@lists.php.net to get a copy of this message | ||
Note Submitter: Henk
----
To vieuw a list form your database use this:
<html>
<head>
<title>Een eenvoudig voorbeeld van een PHP script</title>
</Head>
<body>
<h2>Lijst van alle landen per werelddeel</h2>
<table border="1" cellpadding="3">
<tr>
<strong>
<th>land_id</th>
<th>land</th>
</strong>
</tr>
<?php
mysql_connect("server","username","password");
mysql_select_db("Enigma09_");
$query = "SELECT * FROM landen ORDER BY werelddeel";
$resultaat = mysql_query($query);
while ($row = mysql_fetch_array($resultaat)) {
?>
<tr>
<td><?php echo $row["land_id"]; ?></td>
<td><?php echo $row["land"]; ?></td>
<td align="right"><?php echo $row["inwoners"]; ?></td>
</tr>
<?php
}
?>
</table>
</body>
</html>