Whats the best way to collect all the users where server_id = X
Table:
id server_id user
1 2761 adam
2 2567 tom
3 2761 luke
4 2761 mike
5 2346 lucy
So what should I do to echo all users where server_id = 2761
?
What output should look like...
Adam, Luke, Mike
What I think is:
$voter_count = "SELECT user FROM `voters` WHERE `server_id`='2761'";
$voter_result = mysql_query($voter_count);
if ($voter_result > 0) {
echo implode(", ", mysql_fetch_array($voter_result));
}else{
echo "No one has voted today using their username - be the first!";
}
but this results this result:
adam, adam
Thanks in adavce!