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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:18:45+00:00 2026-06-04T01:18:45+00:00

I have a PHP-based site with bookings/appointments stored in a MySQL database. I want

  • 0

I have a PHP-based site with bookings/appointments stored in a MySQL database.

I want to set an e-mail notification to be sent to each person who made a booking exactly 24 hours before their booking. Bookings are added through a regular PHP form.

I know I could add a script to, for instance, the index page that checks the database for any bookings that are in the final 24 hours, but that’s unreliable since I won’t be getting much traffic at first. So the index page could go hours without visits, and the notification would be hours late.

The other solution that came to mind is to set a cron job that runs every minute, calls a PHP script which checks whether any e-mails should be sent and sends them. But I’m not sure if this is overkill in a way; does anyone have a better solution than having something run in the background every minute?

To sum it up – is there a way to do this without cron?

  • 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-04T01:18:47+00:00Added an answer on June 4, 2026 at 1:18 am

    Triggering the job from a web page is a very bad idea, for two reason: (1) if you don’t get traffic to your site, the job doesn’t run; (2) if you get a lot of notifications, the job will be slowing down the response to the web requests (assuming you invoke the job synchronously).

    I would strongly discourage you from running a job every minute either – it definitely will be an overkill. Instead, think whether you really need “exactly 24 hours” as the interval or would “between 22 and 26 hours” be ok.

    We have a similar requirements – and went about it by setting a job that runs every 4 hours and checks what notifications need to be sent for events starting between 22 and 26 hours form the time the script runs. This way, the script is only execute 6 times in a day and everything gets sent correctly.

    If 4 hours approximation is not good enough, then think to the largest interval that’s appropriate. I’m sure 1 hour should be sufficient. Have a script run once an hour (from cron) and check for events starting between 23 and 24 hours from the time of the run.

    Remember that once your email is sent, it doesn’t end up in the recipient’s inbox immediately: sometimes it takes a few seconds, but sometimes it may take an hour or even more – so an extra hour difference in your script won’t be a problem.

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

Sidebar

Related Questions

I have a site based on php/mySQL where publishers had inserted a lot of
I am creating a very large PHP MVC-based site that will have a large
I have different php output in jQuery-based tabs. This output is formed from database
I have a web-site based on PHP, to which I would like to add
I have a pre-existing user database on my site. Now, I want to install
I'm working on javascript/jquery in a php based site, and I have to redirect
I have a small PHP based directory indexor on my site. One of the
I have a dynamic php (Yii framework based) site. User has to login to
On a PHP-based web site, I want to send users a download package after
Scope: PHP-mysql based site, using memcached. Caching issue is mostly about prices. Because of

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.