954,585 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Exicution of PHP code at spacific time without any action/event

hello

I want to execute some queries at specific date with out any action on event(i.e on load, on change). I want the file placed on my server will automatically execute at the first of every month. would you help me????? Its Urgent..

BzzBee
Posting Whiz
327 posts since Apr 2009
Reputation Points: 16
Solved Threads: 48
 

Put the code in a separate php file and run it as a cron job :D

ithelp
Nearly a Posting Maven
Banned
2,230 posts since May 2006
Reputation Points: 769
Solved Threads: 128
 

You are right. but i don't know much about corn job and i want to execute a mysql query. how can i do that?

BzzBee
Posting Whiz
327 posts since Apr 2009
Reputation Points: 16
Solved Threads: 48
 

i have a php file containing all the code that i want to execute, how can i apply corn job on it? How can i can concatenate corntab or cornjob with my php file?

BzzBee
Posting Whiz
327 posts since Apr 2009
Reputation Points: 16
Solved Threads: 48
 

Run a if statement using the date() function.

php.net => date() for examples

OmniX
Practically a Master Poster
656 posts since Dec 2007
Reputation Points: 31
Solved Threads: 10
 

If you have a linux server, then maybe this could help.
http://www.modwest.com/help/kb5-125.html

nav33n
Purple hazed!
Moderator
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
 

thanks for help. my file has all executable permissions like 755 and i have linux server but how i can apply corn job on my file. just tell me this in easiest way

BzzBee
Posting Whiz
327 posts since Apr 2009
Reputation Points: 16
Solved Threads: 48
 
thanks for help. my file has all executable permissions like 755 and i have linux server but how i can apply corn job on my file. just tell me this in easiest way

Did you check the link Look here to see how to setup your own crontab ? You can add a line (or cronjob) in crontab file. This crontab file executes the cronjob at the specified time.

nav33n
Purple hazed!
Moderator
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
 

yes i have checked this link, and its really helpful and i am 50% near to solution. where the cron file exist? at base directory? or some where else?

BzzBee
Posting Whiz
327 posts since Apr 2009
Reputation Points: 16
Solved Threads: 48
 

hello nav33n
line from your link

login to your shell using ssh.... how can i login to my shell????

BzzBee
Posting Whiz
327 posts since Apr 2009
Reputation Points: 16
Solved Threads: 48
 

oh my problem is solved.... thanks to all for guidance

BzzBee
Posting Whiz
327 posts since Apr 2009
Reputation Points: 16
Solved Threads: 48
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You