brosskgm Posted February 18, 2010 Share Posted February 18, 2010 OK, here is what I'm trying to do. I have the following records in mysql. I'm trying to find examples or some routine that will help me find a way that when the date_to_be_notified matches current date that we can get the server to send an email and or text message out. Thanks for your help. include("connect.php"); $username = $_POST['username']; $date = $_POST['date']; $buyer_name = $_POST['buyer_name']; $contract = $_POST['contract']; $extended_warranty = $_POST['extended_warranty']; $type_of_contract = $_POST['type_of_contract']; $date_to_be_notified = $_POST['date_to_be_notified']; $notify_email = $_POST['notify_email']; $notify_text = $_POST['notify_text']; $message = $_POST['message']; $query = "INSERT INTO contract_tracker (id, username, date, buyer_name, contract, extended_warranty, type_of_contract, date_to_be_notified, notify_email, notify_text, message) VALUES ('', '$username', '$date', '$buyer_name', '$contract', '$extended_warranty', '$type_of_contract', '$date_to_be_notified', '$notify_email', '$notify_text', '$message')"; $results = mysql_query($query); Quote Link to comment Share on other sites More sharing options...
trq Posted February 18, 2010 Share Posted February 18, 2010 I don't see how that code relates at all to your question. You will obviously need to execute a select query. Quote Link to comment Share on other sites More sharing options...
LeadingWebDev Posted February 18, 2010 Share Posted February 18, 2010 when the date_to_be_notified matches current date that we can get the server to send an email and or text message out. First you need a script that will check dates in database "SELECT", not INSERT, as thorpe said. second to get server send mail/msg automatically you will need to schedule cron. $date= "date()?" // depends on how u store date in db $query=mysql_query("SELECT * FROM `contact_tracker` WHERE `date_to_be_norified` = '$date'"); actually if u have date stored dd/mm/yyyy or whatever else it will help. Quote Link to comment Share on other sites More sharing options...
brosskgm Posted February 18, 2010 Author Share Posted February 18, 2010 OK, thanks. This gives me something to start on. I might have posted this in the wrong area. I might need a cgi or perl script to call from a cron to do this also. when the date_to_be_notified matches current date that we can get the server to send an email and or text message out. First you need a script that will check dates in database "SELECT", not INSERT, as thorpe said. second to get server send mail/msg automatically you will need to schedule cron. $date= "date()?" // depends on how u store date in db $query=mysql_query("SELECT * FROM `contact_tracker` WHERE `date_to_be_norified` = '$date'"); actually if u have date stored dd/mm/yyyy or whatever else it will help. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.