Php/Mysql online counter[solved]
Ok i have this script
Code:
<?
mysql_connect("127.0.0.1", "sttimy", "******")or die(mysql_error());
mysql_select_db(site);
$conline = mysql_query("SELECT COUNT(Username) FROM Useraccount where online='1'");
$online = mysql_result($conline,0);
echo $online;
?>
Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /home/sttimy/public_html/index.php on line 5
That is the error i get, i don't know why because i have another script that has almost the exact same code but it works.
EDIT:
Well i read another topic and it said to use mysql_error() to find out their specific error so i did that and found out that my table Useraccount didn't exist. Well Useraccount didn't but Useraccounts did so i just fixed it up.