I am trying to get information from my MySQL database into HTML table but it seems not to work and I have no clue where's the mistake. Could someone check the code and tell me what I am doing wrong?
<?php
require('db.php');
$sql = mysql_query("SELECT * FROM tablename ORDER BY id ASC");
$id = 'ID';
$fullname = 'fullname';
$password = 'password';
$adres = 'adres';
$telephone = 'telephone';
$registration = 'registration';
while ($rows = mysql_fetch_assoc($sql)){
}
?>
<table width="100%" border="1">
<thead><tr>
<td>Klantennummer</td>
<td>Volledige naam</td>
<td>Email</td>
<td>Adres</td>
<td>Klant bewerken</td>
<td>Klant verwijderen</td>
</tr>
</thead>
<tbody>
<?php
while( $rows = mysql_fetch_assoc($sql) ){
echo
"<tr>
<td>{$rows\['id'\]}</td>
<td>{$rows\['fullname'\]}</td>
<td>{$rows\['email'\]}</td>
<td>{$rows\['adres'\]}</td>
</tr>\n";
}
?>
</tbody>
</table>