Hello friends I have a very strange error with my code to see who is connected but this works when you want there is one that comes online and there are others offline and the weird thing is that there are others that do not even leave anything because that happens a help to be able see who is connected and who is not equal to facebook in the friends menu
session_start();
$userID = '9'; //user
$online = 'yes';
$time_check = $online-10; //We Have Set Time 1 Minutes
$sql="SELECT * FROM user WHERE userID='$userID'"; $result=mysql_query($sql);
$count=mysql_num_rows($result);
//If count is 0 , then enter the values
if($count=="no"){
$sql="INSERT INTO user(userID, online)VALUES('$userID', '$online')";
$result=mysql_query($sql);
}
// else update the values
else {
$sql="UPDATE user SET online='$online' WHERE userID = '$userID'";
$result=mysql_query($sql);
}