Thank you. The reason I did that was because it helped to stop an other problem.
Now I made the script correct as you said, but if the script gets more then 2 outputs out the MySQL database it shows the number of results, but al with the same data. So, for example I have 3 outputs from the script which would look like:
Found BLA to BLE with:
A
A
A
instead of:
Found BLA to BLE with
A
B
C
So the number of results is correct, 3, but it contains al the same data as number 1...
Can someone confirm I have to look at:
for($i=0;$i<$aantal_lijnen;$i++)
Or did I made an mistake somewhere else?
$res=mysql_db_query("$db","SELECT Maatschappij, Prijs, Consumptie FROM Vluchten WHERE Vertrek='$van' AND Aankomst='$naar';",$dbh);
$row=mysql_fetch_row($res);
$aantal_lijnen=mysql_num_rows($res);
if ($row[0]=="")
{echo "<b>Didn't found anything</b><br><br>";}
else
echo "Found <b>$van</b> to <b>$naar</b> with";
for($i=0;$i<$aantal_lijnen;$i++)
echo "Maatschappij: <b>$row[0]</b> Prijs: <b>$row[1]</b> Consumptie: <b>$row[2]</b><br><br>";
echo "<a href=\"$PHP_SELF\">Zoek opnieuw</a>";
}