Could anyone help me to correct user online code: I am stuck in this point... CREATE TABLE useronline ( timestamp int(15) NOT NULL default '0', ip varchar(40) NOT NULL default '', file varchar(100) NOT NULL default '', PRIMARY KEY (timestamp), KEY ip (ip), KEY file (file) ) TYPE=MyISAM; <?php $host = "localhost"; $db_user = "socheat"; $db_pass = "socheat"; $db_name = "ppdirectory"; $timeoutseconds=300; //get the time $timestamp = time(); $timeout = $timestamp-$timeoutseconds; //connect to database mysql_connect($host, $db_user, $db_pass); //insert the values mysql_db_query("$db_name", "INSERT INTO useronline VALUES('$timestamp','$REMOTE_ADDR','$PHP_SELF')"); print("INSERT INTO useronline VALUES('$timestamp','$REMOTE_ADDR','$PHP_SELF')"); //delete values when they leave mysql_db_query($db_name, "DELETE FROM useronline WHERE timestamp<$timeout"); //grab the results $result = mysql_db_query($db_name, "SELECT DISTINCT ip FROM useronline WHERE file='$PHP_SELF'"); //number of rows = the number of people online $user = mysql_num_rows($result); //spit out the results mysql_close(); if($user == 1) { print("$user user online\n"); } else { print("$user users online\n"); } ?> -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php