why code users_online is auto increment when refresh
<p>when i refresh this page users is auto increment</p>

<pre><code>&lt;?
    $session= session_id();
    $time=time();
    $time_check=$time-600; //SET TIME 10 Minute
    include "conf.php" ;
    $tbl_name="user_online"; /// Table name
     //search for session id in database
    $result=mysql_query("SELECT * FROM $tbl_name WHERE session='$session'" );
    $count=mysql_num_rows($result);
    if($count=="0"){
      // if not found insert
    $result1=mysql_query("INSERT INTO $tbl_name(session, time)VALUES('$session', '$time')");
    }
    else {
      // if found update data
    $result2=mysql_query("UPDATE $tbl_name SET time='$time' WHERE session = '$session'");

    }
    $result3=mysql_query("SELECT * FROM $tbl_name");
    $count_user_online=mysql_num_rows($result3);
    echo "User online : $count_user_online ";
    // if over 10 minute, delete session
    $result4=mysql_query("DELETE FROM $tbl_name WHERE time&lt;$time_check");

    mysql_close();
    // Open multiple browser page for result
    ?&gt;
</code></pre>
