Lid |
|
Hier is er een
<?php
$con = mysql_connect("localhost","Piet","abc123");
if (!$con)
{
die('Kan niet verbinden: ' . mysql_error());
}mysql_select_db("my_db", $con);
$result = mysql_query("SELECT * FROM personeel");
echo "<table border='1'>
<tr>
<th>Voornaam</th>
<th>Achternaam</th>
</tr>";while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['VoorNaam'] . "</td>";
echo "<td>" . $row['AchterNaam'] . "</td>";
echo "</tr>";
}
echo "</table>";mysql_close($con);
?>
<?php if (!$con) { <tr> <th>Voornaam</th> <th>Achternaam</th> { echo "<td>" . $row['VoorNaam'] . "</td>"; echo "<td>" . $row['AchterNaam'] . "</td>"; } echo "</table>";mysql_close ($con); ?>
alsjeblieft
Marcel, |