hallo mensen van one2xs,
ik ben bezig met een vote lijst voor mijn minecraft server.
deze lijst laat zien wie er het meest heeft gevote etc.
dit is een stukje van de file dat ik niet fixed krijg.
ik volg een cursus op een site die heel veel geholpen heb maar ik kom niet verder.
dit is de code.
dit is het resultaat:
Has voted # %username% time(s)
%username% heb ik ff zo getypet voor de duidelijkheid normaal staat hier een naam.
# is het aantal votes.
$row[COUNT(id)] is het aantal votes oftewel #
en $row[minecraft_user] is de naam van de gebruiker oftewel %username%
Ik wil dit omdraaien maar dat lukt mij niet.
kan iemand helpen?
dit moet er komen te staan
%username% has voted # time(s)
ik ben bezig met een vote lijst voor mijn minecraft server.
deze lijst laat zien wie er het meest heeft gevote etc.
dit is een stukje van de file dat ik niet fixed krijg.
ik volg een cursus op een site die heel veel geholpen heb maar ik kom niet verder.
[COLOR= #0000BB]<?php
$con[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_connect"]mysql_connect[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"localhost"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"root"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"password"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][COLOR= #0000BB]$con[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]Could not connect: [/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());
}[/COLOR]
[URL="http://www.php.net/mysql_select_db"]mysql_select_db[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"vote"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$con[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$query[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"SELECT minecraft_user, COUNT(id) FROM votes GROUP BY minecraft_user"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$result[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
[COLOR= #FF8000]// Print out result[/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]$result[/COLOR][COLOR= #007700])){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Has voted "[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]COUNT(id)[/COLOR][COLOR= #007700]] .[/COLOR][COLOR= #DD0000]" "[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]minecraft_user[/COLOR][COLOR= #007700]] .[/COLOR][COLOR= #DD0000]" time(s)."[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<br />"[/COLOR][COLOR= #007700];
}[/COLOR]
?> dit is de code.
dit is het resultaat:
Has voted # %username% time(s)
%username% heb ik ff zo getypet voor de duidelijkheid normaal staat hier een naam.
# is het aantal votes.
$row[COUNT(id)] is het aantal votes oftewel #
en $row[minecraft_user] is de naam van de gebruiker oftewel %username%
Ik wil dit omdraaien maar dat lukt mij niet.
kan iemand helpen?
dit moet er komen te staan
%username% has voted # time(s)