Let me preface this by saying im a total rookie when it comes to this stuff...
I'm trying to add this little php script to my website which should display the number of users currently in my chat room.
Unfortunately, when I added it to my site, nothing happened. No error message, no text displayed...nothing.
Any help would be greatly appreciated.
I looked in the SQL manager just to confirm that the user name and database name were correct, and they were.
><?php
@ $db = mysql_pconnect("localhost", "cheapas_cheapyd", "PASSWORD");
if (!$db)
{
echo "MySQL ERROR: Could not connect to the Chat DB. Please try later.";
exit;
}
mysql_select_db("cheapas_pchat1");
$query = "SELECT DISTINCT username FROM c_users";
$result = mysql_query($query);
$num_results = mysql_num_rows($result);
echo "There are ".$num_results." users in the chat.";
?>
Thanks in advance!