Results 1 to 1 of 1

Thread: Php/Mysql online counter[solved]

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2005
    Posts
    238

    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.
    Last edited by Tempestknight; Apr 8th, 2006 at 09:08 AM.
    The Tempest Shall Never Die.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width