Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1107355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:55:32+00:00 2026-05-17T01:55:32+00:00

when i refresh this page users is auto increment <? $session= session_id(); $time=time(); $time_check=$time-600;

  • 0

when i refresh this page users is auto increment

<?
    $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<$time_check");

    mysql_close();
    // Open multiple browser page for result
    ?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T01:55:32+00:00Added an answer on May 17, 2026 at 1:55 am

    Maybe you don’t start session ? please add page header session_start(); code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do I use PHP to auto-increment a numeric variable on page refresh? Foe
This relates to my previous post: jQuery .load Method causing page refresh AJAX I
I already asked this question but at that time I tought that the refresh
Notice this post: Auto-refresh echo One solution was to do this: down vote $(function(){
I have this page, let's call it index.php index.php has a list of users
I've been through the forum and tried this post (http://stackoverflow.com/questions/7128417/stop-javascript-auto-refresh-after-fix-time-for-example-1-min). I'm busy with a
This is quite complicated but i would like to be able to refresh a
I refresh pages by writing window.location = window.location; . However this doesn't work on
I try to refresh background image of an uibutton, this is the code for
I'm trying to use timer to refresh an image from the internet. This is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.