User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 426,482 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,182 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting

PHP reminder E-mail - Cron job to run the script

Join Date: Sep 2005
Posts: 689
Reputation: digital-ether has a spectacular aura about digital-ether has a spectacular aura about 
Rep Power: 6
Solved Threads: 41
Moderator
digital-ether's Avatar
digital-ether digital-ether is offline Offline
Practically a Master Poster

Re: PHP reminder E-mail - Cron job to run the script

  #4  
May 10th, 2008
Originally Posted by oku View Post
The cron will be the easy part - its just structuring the script that i'm finding difficult


Really depends on how you're updating the database. If you're updating just for the case of sending out emails when the domains expire, then you can just delete the rows in the db when you send out an email..

Your query:
SELECT domain_name from domains_table where exp_date > NOW();

Iterate through each row, send email and remove row. Otherwise, you could add another column with the email send timeboolean. So your query would be something like:
SELECT domain_name from domains_table where exp_date > NOW() AND sent_email == FALSE;

Is that what you're trying to do?
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Reply With Quote  
All times are GMT -4. The time now is 4:28 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC