Jump to content

ampsman

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Everything posted by ampsman

  1. woohoo!!! got it working! Here is the final code for anyone with the same question. <?php $username = "username"; $password = "password"; $hostname = "localhost"; //connection to the database $dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL"); //select a database to work with $selected = mysql_select_db("db_name",$dbhandle) or die("Could not select examples"); //execute the SQL query and return records $result = mysql_query("SELECT * FROM table WHERE date_field = DATE_ADD(curdate(), INTERVAL 3 DAY)"); //fetch tha data from the database while ($row = mysql_fetch_array($result)) { mail("xxxx@xxx.com", "Subject", "body"); } //close the connection mysql_close($dbhandle); ?>
  2. so I think I am getting closer. something like this will find any records that have a date 3 days away. $result = 'SELECT * FROM emp_info WHERE StartDate = DATE_ADD(curdate(), INTERVAL 3 DAY);'
  3. thank you. specifically I simply want to check if any dates in column X are within X days of todays date. If yes then email the results.
  4. anybody?
  5. I found this, http://stackoverflow.com/questions/1393516/how-to-compare-a-date-from-mysql-with-current-date-and-send-a-notification-email. I have been playing around with it but havent had any luck. Has anyone done something similar before?
  6. How would I go about creating a script to check a date in mysql and if that date is within X days it will send an email alert.
×
×
  • Create New...

Important Information

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.