On my website I have this PHP code:
while(1) {
sleep(1);
if ($result->num_rows == 0) {
$players = "0 Players";
} else if ($result->num_rows == 1) {
$players = "1 Players";
} else if ($result->num_rows == 2) {
$players = "2 Players";
} else if ($result->num_rows == 3) {
$players = "3 Players";
} else if ($result->num_rows == 4) {
$players = "4 Players";
} else if ($result->num_rows == 5) {
$players = "5 Players";
} else if ($result->num_rows == 6) {
$players = "6 Players";
} else if ($result->num_rows == 7) {
$players = "7 Players";
} else if ($result->num_rows == 8) {
$players = "8 Players";
} else if ($result->num_rows == 9) {
$players = "9 Players";
}
}
The problem is that the page will not load. My guess is that the PHP loop needs to end before the page will load. However this needs to be running while the page is finished loading.
Any ideas? Thanks in advance.
And also if it helps the website is hosted. The host is NOT slow at all.