Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: See whos Online

  1. #1
    Regular Coder
    Join Date
    Jan 2008
    Thanked 0 Times in 0 Posts

    See whos Online

    Hello, I'm back yet again with another question. Since you guys was so helpful the last time I figure you guys could probably help this time. Its simple really what I'm doing, but I can't seem to figure out why my problem is with this. Ok so the goal here is to make a script to check and see whos online. How that works is in the database whenever someone logs in the column in the database turns from 0 to 1, which means that they are online. The problem here that I'm having is making a script that whenever it turns to 1 it will add to up and up. For example, one player was online and then another person logged it and that would make it two. I thought at first this should be fairly simple, which shortly after messing around with this realizeing how bad my knowledge really is in PHP. So this is what I tried.

    PHP Code:


    $con) {
    'Server Error: ' mysql_error());


    $online_players mysql_query("SELECT FROM characters WHERE online = '1'") or die('Database Error: ' mysql_error());

    $players_online mysql_num_rows($online);

    But whenever I tried that I got the following error:

    Server Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM characters WHERE online ='1'' at line 1

  2. #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Thanked 2,233 Times in 2,220 Posts
    SELECT FROM characters WHERE online = '1'"
    select WHAT from characters ?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


Posting Permissions

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