Hoi,
Om mijn PHP "kennis" (voor zover je het kunt noemen) te verbeteren ging ik wat doen met gegevens in een db proppen en er weer uithalen. Nu wil ik dat hij de gegevens netjes in een tabel zet, maar helaas zet hij er maar 1 rij in en niet de hele tabel. Hoe zorg ik dat ik de hele tabel erin prop?
http://gratisgastenboek.be/overig/test/gegevens.php
Hij zet nu enkel de laatst toegevoegde waarde in de tabel.
Ik hoop dat jullie mij verder kunnen helpen.
Om mijn PHP "kennis" (voor zover je het kunt noemen) te verbeteren ging ik wat doen met gegevens in een db proppen en er weer uithalen. Nu wil ik dat hij de gegevens netjes in een tabel zet, maar helaas zet hij er maar 1 rij in en niet de hele tabel. Hoe zorg ik dat ik de hele tabel erin prop?
http://gratisgastenboek.be/overig/test/gegevens.php
Hij zet nu enkel de laatst toegevoegde waarde in de tabel.
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]config.php[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"SELECT * FROM `opslaan` LIMIT 0, 30 "[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Fout bij uitvoeren geconstateerd"[/COLOR][COLOR= #007700]);[/COLOR]
?>
[COLOR= #0000BB]<?[/COLOR] [URL="http://www.php.net/while"]while[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$var[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_array"]mysql_fetch_array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700])){[/COLOR]
[COLOR= #0000BB]$result1[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$var[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$result2[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$var[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aantal[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$result3[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$var[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]datum[/COLOR][COLOR= #007700]];
}[/COLOR]
?>
<TABLE BORDER="1">
<TR>
<TD WIDTH="120" HEIGHT="20"><b>ID</b></TD>
<TD WIDTH="120"><b>Aantal</b></TD>
<TD WIDTH="120"><b>Datum</b></TD>
</TR>
<TR>
<TD HEIGHT="20">[COLOR= #0000BB]<?[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"$result1"[/COLOR][COLOR= #007700];[/COLOR] ?></TD>
<TD>[COLOR= #0000BB]<?[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"$result2"[/COLOR][COLOR= #007700];[/COLOR] ?></TD>
<TD>[COLOR= #0000BB]<?[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"$result3"[/COLOR][COLOR= #007700];[/COLOR] ?></TD>
</TR>
</TABLE> Ik hoop dat jullie mij verder kunnen helpen.

Ik kon namelijk nergens zo gauw iets vinden over data in een tabel plaatsen. 