octron
Gebruiker
- Lid geworden
- 4 mrt 2008
- Berichten
- 65
zoals de titel zecht hij print alles dubbel af.
[SMALLIMG]http://img23.imageshack.us/img23/6797/33835918yv8.jpg[/SMALLIMG]

dit komt er uit ....
hij print nu alles 4 keer af omdat er 4 records in de database staan.
weet er iemand hoe ik dit probleem op kan lossen?
mvg, Michel
PHP:
<form form name=ververs action="tabelmaand.php" method="post">
maand <select name="maand1" onChange="ververs.submit();">
<option>april</option>
<option>mei</option>
<option>juni</option>
<option>july</option>
<option>augustus</option>
<option>september</option>
</select>
</form>
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("boot", $con);
echo"maand: ";
echo"<b>";
echo $_POST["maand1"];
echo"</b>";
echo"<p></p>";
echo"<table border='1'>";
echo"<tr>";
echo"<th>dag nummer</th>";
echo"<th>ochtend</th>";
echo"<th>middag</th>";
echo"<th>avond</th>";
echo"</tr>";
for($nummer=1;$nummer<=31;$nummer++){
$result2 = mysql_query("SELECT * FROM reservering");
while($row2 = mysql_fetch_array($result2))
{
echo"<tr>";
if ($nummer == $row2['dag']& $row2['maand'] == $_POST["maand1"]){
if ($row2['dagdeel']== "ochtend"){
echo '!!!111';
echo"<td>$row2[dag]</td>";
echo"<td>$row2[naam] $row2[achternaam]</td>";
echo"<td></td>";
echo"<td></td>";
}
else if ($row2['dagdeel']== "middag"){
echo '!!!222';
echo"<td>$row2[dag]</td>";
echo"<td></td>";
echo"<td>$row2[naam] $row2[achternaam]</td>";
echo"<td></td>";
}
else if($row2['dagdeel']== "avond"){
echo '!!!333';
echo"<td>$row2[dag]</td>";
echo"<td></td>";
echo"<td></td>";
echo"<td>$row2[naam] $row2[achternaam]</td>";
}
}
else {
echo"<td>$nummer</td>";
echo"<td>vrij</td>";
echo"<td>vrij</td>";
echo"<td>vrij</td>";
}
}
}
echo"</tr>";
echo"</table>";
//de 2e tabel
mysql_close($con);
?>

dit komt er uit ....
hij print nu alles 4 keer af omdat er 4 records in de database staan.
weet er iemand hoe ik dit probleem op kan lossen?
mvg, Michel
Laatst bewerkt door een moderator: