FT3 Posted October 25, 2009 Report Share Posted October 25, 2009 (edited) Labdien. man vjg parveidot kodu ta lai ņemtu lietotajus no table users un raditu cik ir online un lai raditu cik useri nau registreti rekur kods <?php include_once('includes/db_connect.php'); $guests = ''; $users = ''; $link = mysql_connect($INFO['sql_host'],$INFO['sql_user'],$INFO['sql_pass']); mysql_query('use '.$INFO['sql_database'].';'); $now = time()-1050; $result = mysql_query('select count(*) from '.$INFO['sql_tbl_prefix'].'sessions where member_id = 0 && running_time > '.$now.';'); $r = mysql_fetch_array($result); if ($r[0]>0) { $guests = $r[0]; } else { $guests = 0; } $result = mysql_query('select count(*) from '.$INFO['sql_tbl_prefix'].'sessions where member_id > 0 && running_time > '.$now.';'); $r = mysql_fetch_array($result); if ($r[0]>0) { $users = $r[0]; } else { $users = 0; } echo 'Lietotāji ('.$users.'), Viesi ('.$guests.')'; mysql_close($link); ?> Edited October 25, 2009 by FT3 Link to comment Share on other sites More sharing options...
_Yu-Gi-Oh__ Posted October 28, 2009 Report Share Posted October 28, 2009 $guests-$users, ne? Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now