$sql = "SELECT COUNT( tblnieuwsreacties.nieuwsreactiesPoster ) , GebruikersLoginnaam FROM tblnieuwsreacties, tblgebruikers WHERE tblnieuwsreacties.nieuwsreactiesPoster = tblgebruikers.GebruikersLoginnaam GROUP BY tblgebruikers.GebruikersLoginnaam UNION ALL SELECT COUNT( tblstandpuntreacties.standpuntreactiesPoster ) , GebruikersLoginnaam FROM tblstandpuntreacties, tblgebruikers WHERE tblstandpuntreacties.standpuntreactiesPoster = tblgebruikers.GebruikersLoginnaam GROUP BY tblgebruikers.GebruikersLoginnaam ORDER BY 1 DESC LIMIT 0 , 5"; $query = mysql_query($sql) or die (mysql_error()); while ($line = mysql_fetch_array ($query, MYSQL_NUM)) { $a = $line[0]; $t = $line[2]; $som = ($a+$t); $gebruiker = $line[1]; echo '
'; echo ''.$gebruiker.'
Aantal posts : '.$som.'
'; echo '
'; }