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

  • Home
  • SEARCH
  • 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 8480773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:23:10+00:00 2026-06-10T19:23:10+00:00

I have made a server – client app in android with php and mysql.

  • 0

I have made a server – client app in android with php and mysql. When any new user registers and clicks on submit button then his/her information goes to php and gets stored in mysql database that is on the internet.

And then i have get that list of peoples in listview who are registered before in my app and in listview i can see all that people but now i want to add a functionality that can check who is online right now in my app. I will make two buttons ONLINE and OFFLINE. When i press the ONLINE buttons only those people should be display who are using this app right now.

I have also search this in web but i dint find any proper result, so please anybody who have made this before please give me some idea or link of tutorial regarding this.
Thank you for your time.

  • 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-06-10T19:23:12+00:00Added an answer on June 10, 2026 at 7:23 pm

    In your DB, add a field called (last_login as DateTime). This field is updated each time the user logins to the application, and start a new session. Use a query similar to the below.

    UPDATE tbl_users SET last_login=NOW() WHERE ID_FIELD = $USER_ID

    Whenever a user clicks the (Who is Online) button, a PHP script is called that queries all the user where the last_login field contains a value for example less than 3 hours.

    The query you can use

    SELECT * FROM tbl_users WHERE TIMESTAMPDIFF(HOUR,last_login,NOW()) <=3

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

Sidebar

Related Questions

i have made a server using php. The server is getting new information after
I have made a simple server -client code in python socket programming. Client side
I have made a client and server application. In that when ever i am
I have made two kernel modules for client and server which are transmitting the
I have made a wcf application, and a client. WCF app. have to know
I have made a client application for LDAP Server(especially for Microsoft AD) in java
I have made a TCP/IP Server/Client, its asynchronous but it concatenates the messages. How
I have made a server and a client in C# which transfers files. But
I have made an Android app where items can be purchased using in-app-billing .
I have made an client - server example using netty. I have defined handlers

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.