Made this real quick :P
PHP Code:
<?php
= "localhost";
= "root";
= "pass";
= "database";
= mysql_connect(, , ) or die(mysql_error());
mysql_select_db(, ) or die(mysql_error());
function countOnline(){
global ;
= "SELECT * from characters where online = '1'";
= mysql_query(,);
return (mysql_numrows() > 0);
}
echo countOnline();
mysql_close();
?>
This will display the amount of players online, in a number ex.
Now, if you want to change the color the text is displayed in do something like this:
PHP Code:
echo "<span style="color: blue;">".countOnline()."</span>";
Now in php you've got to put quotes - " " around html and then a . to show you're using a function.
You can do all sorts of things with this and some basic html knowledge.
Anyways, Enjoy!