Nog onervaren in het maken van een database, is het me al gelukt om een tabel te maken, in te voeren en de gegevens eruit te halen.
Nu heb ik alleen gemerkt dat mijn gemaakte html niet ALLE records toont in de getoonde html pagina.
Ik gebruik de functie ORDER by.
Dit is de php code:
<?php
$Achternaam = mysql_query("SELECT * FROM `NAW` ORDER BY `NAW` . `Achternaam` ASC") or die (mysql_error());
$record = mysql_fetch_assoc($Achternaam);
?>
Dit is mijn gebruikte html:
<table width="100%" border="1" cellpadding="2" cellspacing="0" bordercolor="#7B7BC0" id="Kop">
<tr>
<td align="left" valign="middle" width="120" height="22"><font style="font-size:13px" color="#000000" face="Trebuchet MS"><b>Achternaam</b></font></td>
<td align="left" valign="middle" width="80" height="22"><font style="font-size:13px" color="#000000" face="Trebuchet MS"><b>Voornaam</b></font></td>
<td align="left" valign="middle" width="60" height="22"> </td>
<td align="left" valign="middle" width="220" height="22"><font style="font-size:13px" color="#000000" face="Trebuchet MS"><b>E-mail adres</b></font></td>
<td align="left" valign="middle" width="85" height="22"><font style="font-size:13px" color="#000000" face="Trebuchet MS"><b>Telefoon</b></font></td>
<td align="left" valign="middle" width="85" height="22"><font style="font-size:13px" color="#000000" face="Trebuchet MS"><b>Gsm</b></font></td>
</tr>
</table>
<?php
echo '<table width="100%" border="1" cellpadding="2" cellspacing="0" bordercolor="#7B7BC0" id="Adressen">';
while ($record = mysql_fetch_assoc($Achternaam)){
echo '
<td align="left" valign="middle" width="120" height="20"><font style="font-size:13px" color="#000000" face="Trebuchet MS">'.$record['Achternaam'].'</font></td>
<td align="left" valign="middle" width="80" height="20"><font style="font-size:13px" color="#000000" face="Trebuchet MS">'.$record['Voornaam'].'</font></td>
<td align="left" valign="middle" width="60" height="20"><font style="font-size:13px" color="#000000" face="Trebuchet MS">'.$record['Voegsel'].' </font></td>
<td align="left" valign="middle" width="220" height="20"><font style="font-size:13px" color="#000000" face="Trebuchet MS">'.$record['Email'].' <a href="mailto:'.$record[Email].'"><img src="images/Mail2.PNG" alt="Stuur een e-mail" align="top" border="0" width="16" height="16"></a>
</font></td>
<td align="left" valign="middle" width="85" height="20"><font style="font-size:13px" color="#000000" face="Trebuchet MS">'.$record['Telefoon'].'</font></td>
<td align="left" valign="middle" width="85" height="20"><font style="font-size:13px" color="#000000" face="Trebuchet MS">'.$record['GSM'].'</font></td>
</tr>';
}
echo '</table>';
?>
<?php
$result = mysql_query("SELECT * FROM `NAW`");
$num_rows = mysql_num_rows($result);
echo '<font style="font-size:13px" color="#000000" face="Trebuchet MS">Er staan totaal '.$num_rows.' leden in de database.</font>';
?>
Wie kan me helpen aan het antwoord waarom hij 1 item niet wil laten zien?
Bedankt voor de hulp.
Groet,
Nanno
[edit]
Code tags toegevoegd [ignore]
[/ignore] en de titel enigszins aangepast.moderator: Danny Roelofs.
[/edit]