You are here: Re: Newbie needs a workaround - No Cron Jobs on Godaddy shared server! « PHP Programming Language « IT news, forums, messages
Re: Newbie needs a workaround - No Cron Jobs on Godaddy shared server!

Posted by nico on 11/18/21 11:38

> Since you're going to do something with your mysql db, use it for logging
> too. Create a table where you will store timestamps of your script's runs.
> Then check for the latest time the script ran and do the job if enough
> amount of time elapsed since.
I appreciate your suggestion, but that means that my script has to
'open' a connection to the database in the first place (this is the
overhead I'm trying to avoid). That's why I'm thinking of a log file
for this.

So, if I log it in the db I have to: 1) Connect 2) Check timestamp 3)If
timestamp says it was run today...Close connection and do nothing, or,
If Timestamp says it wasn't ran, do the check on which users need to be
notified. Whereas, if I do the log file, I 1) Open file and parse
checking for timestamp 2) Then only if I haven't done the notification
check today, THEN connect to db...so if I've already done the work, I
don't have to open up a connection. LMK if I'm missing something ;)


> PS: That script can be called not only from your home pc. It also can be
> called from your index page that in its turn is called a number of times a
> day. With the timestamp checking logic it won't take too much resources.
I thought about that, but initially I might not get a hit every day
(haven't put up the site yet), if this happens, I could have a
notification due the day my index ISN'T hit, and not notify the user.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация