Onbekend |
|
2 while statements, de eerste werkt zoiezo.
Misschien ziet iemand mijn fout.
Alvast bedankt,
<?php
$res = mysql_query("SELECT COUNT(docent) as cdocent, docent FROM storingen GROUP BY docent ORDER BY cdocent DESC LIMIT 0,5");
while ($obj = mysql_fetch_object($res)) {
$query = mysql_query("SELECT aantal FROM storingen_users WHERE naam='".$docent."'");
while ($bla = mysql_fetch_object($query)) {
echo $obj->docent;
echo "<br>";
echo "(".$bla->aantal.")";
echo "<br>";
}
}
?>
<?php $res = mysql_query("SELECT COUNT(docent) as cdocent, docent FROM storingen GROUP BY docent ORDER BY cdocent DESC LIMIT 0,5"); $query = mysql_query("SELECT aantal FROM storingen_users WHERE naam='".$docent."'"); echo "(".$bla->aantal.")"; } } ?>
|