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 3694290
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:28:45+00:00 2026-05-19T04:28:45+00:00

Currently, I have a website that people can open up during a certain team’s

  • 0

Currently, I have a website that people can open up during a certain team’s hockey games. When the hockey team scores, a designated person clicks a button in a secure location. This updates a single entry in MySQL database with the current timestamp.

On the front-end of the website, there is an asynchronous call that runs every 15 seconds to a PHP script to query the database for that timestamp. The script then compares the current time to the timestamp pulled and if it’s within 15 seconds of the current timestamp, it triggers an event on the webpage that includes playing the sound of an air horn and playing a short clip of the team’s goal song.

I usually get a good amount of traffic to the sight during the team’s games, however many people complain about the (up to) 15 second delay after the goal is scored for the sound to be triggered. I’d like to find a way to remedy that.

Obviously, I don’t think querying the database every single second for every single users who is on the page (think 100+) is going to work; I’ll likely kill my database. So, is there another way I can achieve my result? Would it be possible to place a PHP variable into the server’s memory that can be pulled by each session without the negative consequences as using a database or file system read?

EDIT: My host doesn’t have memcached available for me to use and I cannot install it. It’s disappointing because that sounds like it would have been the optimal solution. Does anyone have an alternative idea I could look in to that doesn’t use memcached?

  • 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-19T04:28:45+00:00Added an answer on May 19, 2026 at 4:28 am

    For something like this you want to use a technique known as Comet. Its not particularly difficult, but requires a bit of effort.

    Basically you’ll keep a live connection open to each of the browsers, instead of having them re-open the connection every 15 seconds. This allows you to write to the connection immediately.

    Google for “Comet” and “PHP” and you should find some good resources. http://www.zeitoun.net/articles/comet_and_php/start looks thorough.

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

Sidebar

Related Questions

I currently have an asp.net website hosted on two web servers that sit behind
I have a ASP.Net 2.0 website that is currently using a custom MembershipProvider and
We have our own web server hosting our website that is open to the
I currently have a client website on the Grid server on MediaTemple that will
I currently have an internal website that is running Apache. It is serving some
I have a website that is currently running under .NET 3.5. I am thinking
Currently I'm running several websites that have several (branded) duplicates each, in the same
I have a website that works correctly under IIS 6.0: It authenticates users with
I have recently inherited a website written in Classic ASP, and am currently trying
I am currently coding a website for a band and i have a music

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.