Jump to content

Kryptix

Members
  • Posts

    283
  • Joined

  • Last visited

    Never

Everything posted by Kryptix

  1. It's still displaying all of them. :-\ $db->query('SELECT COUNT(*) FROM_UNIXTIME(login_date) BETWEEN DATE_ADD(NOW(), INTERVAL 1 DAY) AND NOW()'); $stats['online24'] = $db->result($result); Check the bottom right hand side: RuneScape Classic
  2. 'login_date' is a int(10) using PHP's time() function, I believe. An example is: '1256418479' Any suggestions? I really need this to work. :'(
  3. Thanks. No errors now. However, it's showing ALL 5,000+ users as being online in the last 24-hours. Some have their 'login_date' set as '0' so something is wrong. $db->query('SELECT COUNT(user) FROM '.$db->prefix.'rscd_players WHERE login_date BETWEEN NOW() - "24:00:00" AND NOW()'); $stats['online24'] = $db->result($result);
  4. Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\index.php on line 127 $result = $db->query('SELECT user, username FROM '.$db->prefix.'rscd_players ORDER BY creation_date DESC LIMIT 1') or error('Unable to fetch newest registered player', __FILE__, __LINE__, $db->error()); $stats['last_player'] = $db->fetch_assoc($result);
  5. $result = $db->query('SELECT COUNT(user) FROM '.$db->prefix.'rscd_players WHERE `loggedin` BETWEEN NOW() - '24:00:00' AND NOW()) or error('Unable to fetch total player count', __FILE__, __LINE__, $db->error()); $stats['online24'] = $db->result($result); Parse error: syntax error, unexpected T_LNUMBER in C:\xampp\htdocs\index.php on line 127 Any idea? Also, could I have the query for a week and a month too please?
  6. I'm fairly new to PHP. I have a MySQL table called 'users' and a field called 'loggedin' which is in time() format. I need a query that'll check how many players have logged in within the last 24-hours, but I'm not sure where to start. I already have the database connection setup, and just need the amount to be set to "$online24h" Can anyone help me please?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.