Jump to content
  • Register Now

    Sign up and take advantage of the features of our community! Some forums are only accessible to our members!

  • 0

if day and hours in php


ByLost

Question

Version of Files PHP

 Hi Devs

Can anyone help me with php? hope so ^^
I need to run a query every Saturday x hour.

Example:

if(date('D') == 'Sat' AND date('H:i') == '12:00') {
  echo"Metin2Dev";
}

 

Thanks ^^

 

declare: date_default_timezone_set('America/Sao_Paulo');

Thanks. #closerequest

Link to post

3 answers to this question

Recommended Posts

  • 0

If you wanna run a query each Saturday at a specific time I'd highly suggest you're using an Event Scheduler depending on what Query you wanna run.

https://dev.mysql.com/doc/refman/5.7/en/event-scheduler.html

 

This allows you to time reoccuring queries and manage them directly via mysql instead of running php.

  • Love 1

We are the tortured.
We're not your friends.
As long as we're not visible.
We are unfixable.

Link to post
  • 0
11 hours ago, HITRON said:

Use Crons


I'm already using cron on cpanel.
 

wget -q -O - "https://www.myurl/file.php" > /dev/null 2>&1	

Silence cron ^^

#closerequest

11 hours ago, Vanilla said:

If you wanna run a query each Saturday at a specific time I'd highly suggest you're using an Event Scheduler depending on what Query you wanna run.

https://dev.mysql.com/doc/refman/5.7/en/event-scheduler.html

 

This allows you to time reoccuring queries and manage them directly via mysql instead of running php.


I did so to manipulate the data with PHP pulling the data from the database.
Thanks

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.