heya,
your last answers realy helped me out, but i'm still stuck with another question.
what i want to do is the following.
i have a database with this in it:"
id land streek rood wit rose
1 Frankrijk Bordeaux 1 1 0
2 Frankrijk Bourgogne 1 1 0
3 Frankrijk Rhône 1 1 0
4 Frankrijk Provence 1 1 1
5 Frankrijk Loire 1 1 0
6 Frankrijk Elzas 1 1 1
7 Frankrijk Sud-Ouest 1 1 1
8 Frankrijk Languedoc-Rou 1 1 1
9 Frankrijk Vin de Pays 1 1 1
10 Frankrijk Champagne 0 1 1
11 Frankrijk Beaujolais 1 0 0
what i want to do is display all the items where the 4th value is 1, so there is one missing.
now i want to have them in lines of 5.
so this is my output:
Bordeaux Bourgogne Rhône Provence Loire
Elzas Sud-Ouest Languedoc-Roussilion Vin de Pays Beaujolais
Beaujolais
is it possible to get that Beaujolais only once?
(i know it should be possible:P)
for example just this:
Bordeaux Bourgogne Rhône Provence Loire
Elzas Sud-Ouest Languedoc-Roussilion Vin de Pays Beaujolais
this is the code i have so far:
<div id="streken">
<table>
<tr>
<?php
$query = "SELECT COUNT(*) from italie WHERE rood = 1";
$result = mysql_query($query) or die('Error : ' . mysql_error());
while(list($resultaat) = mysql_fetch_array($result, MYSQL_NUM))
{
echo $resultaat;
}
if ($resultaat < 6){
$query = "SELECT id, streek FROM italie WHERE rood = 1 AND land = 'Italie' LIMIT 5";
$result = mysql_query($query) or die('Error : ' . mysql_error());
while(list($sid, $streek) = mysql_fetch_array($result, MYSQL_NUM))
{
?>
<td id="strekenlijst">
<a href="rood.php?id=<?php echo $id?>&sid=<?php echo $sid;?>"><?php echo $streek;?></a>
</td>
<?php }};?>
</tr>
<tr>
<?php
if ($resultaat < 11){
$query = "SELECT streek FROM italie WHERE rood = 1 and id > 10 AND land = 'Italie'LIMIT 5";
$result = mysql_query($query) or die('Error : ' . mysql_error());
while(list($sid, $streek) = mysql_fetch_array($result, MYSQL_NUM))
{
?>
<td id="strekenlijst">
<a href="rood.php?id=<?php echo $id?>&sid=<?php echo $sid;?>"><?php echo $streek;?></a>
</td>
<?php }};?>
</tr>
</table>
</div>