Php accessing a mysql database
$ip = "#####"; //Must be changed to the IP of your server
$port= "43594"; //This must be changed to the port of your server. Default: 43594
if (! $sock = @fsockopen($ip, $port, $num, $error, 5)) //If the server is offline..
{
echo "Players online - ####"; //Then this is echoed
}
else //If the server is online
{
echo "Server offline"; //Then this will be echoed
}
?>
I want the code to access a mysql database and change the "Players online - ####" to the amount of players online. Just make the code, i'll edit it to my database.
|