Hoi
ik ben bezig met een ref actie script
alleen staat in de tabel "leden" de leden en een veld "ref"
in dat veld komt te staan via wie er aangemeld is
hoe kan ik een top 10 maken?
ik heb ut al :
vraag 2 : met de code hier boven staat het niet georderd nu wil ik dus degene met de meeste refs boven aan hebben hoe kan ik dat het beste doen?
ik ben bezig met een ref actie script
alleen staat in de tabel "leden" de leden en een veld "ref"
in dat veld komt te staan via wie er aangemeld is
hoe kan ik een top 10 maken?
ik heb ut al :
[COLOR= #0000BB]<?php
$query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM leden"[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$c[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_array"]mysql_fetch_array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$a[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]();[/COLOR]
[COLOR= #0000BB]$i[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_array"]mysql_fetch_array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700]))
{[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]ref[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][URL="http://www.php.net/in_array"]in_array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]ref[/COLOR][COLOR= #007700]],[/COLOR] [COLOR= #0000BB]$a[/COLOR][COLOR= #007700])) {[/COLOR]
[COLOR= #0000BB]$a[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]] =[/COLOR] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]ref[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$i[/COLOR][COLOR= #007700]++;
}
}
}[/COLOR]
[URL="http://www.php.net/foreach"]foreach[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$a[/COLOR] [COLOR= #007700]AS[/COLOR] [COLOR= #0000BB]$ref[/COLOR][COLOR= #007700]) {[/COLOR]
[COLOR= #0000BB]$t[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM leden WHERE ref="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$ref[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$t[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$t[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$g[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$ref[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$g[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000] [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$t[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000] <br>[/COLOR][COLOR= #007700];
}[/COLOR]
?> vraag 2 : met de code hier boven staat het niet georderd nu wil ik dus degene met de meeste refs boven aan hebben hoe kan ik dat het beste doen?
