I have spent the past 6 hours trying to figure out how to sort my str_repeat alphabetically based on game. So far all I have been able to do is get it to show the first one in the list as if it was alphabetized.
Here is my code.
$result = mysqli_query($con,"SELECT id, ip, port, game FROM dayz_servers");
while($row = mysqli_fetch_array($result)) {
echo str_repeat("<center><h4>" . ($row['3']) . "</h4><a href=\"http://www.gametracker.com/server_info/" . ($row['1']) . ":" . ($row['2']) . "/\" target=\"_blank\"><img src=\"http://cache.www.gametracker.com/server_info/" . ($row['1']) . ":" . ($row['2']) . "/b_560_95_1.png\" border=\"0\" width=\"560\" height=\"95\" title=\" IP: " . ($row['1']) . " Port: " . ($row['2']) . " Game: " . ($row['3']) . "\"/></a><br><br></center>",1);
}
Let the SQL order the results for you.