jj20051 Posted July 13, 2008 Share Posted July 13, 2008 Ok I Have A Database With 20 Users In It. They Each Pay Once A Month On A Specific Day. The Day Of The Month Is Stored As A Single Number. For Instance 13 or 21 . I Have Already Setup A Cron Job To Run The Script Daily. How Do I Have The Script Check The Database To See If Anyone Owes On That Day To Email That User. Certain Days Have Multiple Users. The Email Portion I Already Understand, It's The PHP To Check and Email People. Also If No User Owes On A Specific Day It Won't Send Any Emails ( If or else statement i know ) Link to comment https://forums.phpfreaks.com/topic/114529-auto-send-email/ Share on other sites More sharing options...
Wuhtzu Posted July 13, 2008 Share Posted July 13, 2008 I think we need to see more detail about how your database / tables are laid out. Link to comment https://forums.phpfreaks.com/topic/114529-auto-send-email/#findComment-588937 Share on other sites More sharing options...
jj20051 Posted July 13, 2008 Author Share Posted July 13, 2008 My Database Name Is members The Table they Are Stored In Is Called users. The Columns ( I Think They Are Called Columns ) Are: name , email , date and amount. The Date Is A Single Number Representing The Day Of The Month For Instance 13 Means That They Owe On The 13th Day Of Each Month. The Amount Is In The Format 0.00 such as 1.99 or 12.99 Link to comment https://forums.phpfreaks.com/topic/114529-auto-send-email/#findComment-588938 Share on other sites More sharing options...
teynon Posted July 13, 2008 Share Posted July 13, 2008 <?php $day=date("j"); $sql="SELECT * FROM `table` WHERE `day`={$day}"; $query=mysql_query($sql); while ($req=mysql_fetch_array($query)) { mail($req['UserEmail'], "You must pay for protection.", "You haven't paid for protection. You have one day to pay or god may strike down your building."); } ?> Link to comment https://forums.phpfreaks.com/topic/114529-auto-send-email/#findComment-588942 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.