• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 239
  • Last Modified:

MySQL & PHP Code Question

I have a MySQL database named FLOW. It has a table named INFO. In the info table I have a field named DUE_DATE. I need some type of script that I can put in a scheduled task that will run & look at the DUE_DATE & if the DUE_DATE is within 6 days of todays date, it will call other script I have named EMAIL_EMPLOYEES.php

I'm not sure what programming language would be better to use. If someone could help me get started with the proper code I'd greatly appreciate it. Thanks!

0
wantabe2
Asked:
wantabe2
  • 3
  • 3
1 Solution
 
leakim971PluritechnicianCommented:
what is your plateform ? linux ? unix ? windows ?

http://www.experts-exchange.com/Programming/Languages/Scripting/Perl/Q_23151730.html
SELECT COUNT(*) FROM INFO WHERE DUE_DATE BETWEEN now() AND (now() - interval 6 day)

Open in new window

0
 
nanharbisonCommented:
I think you are looking for a cron job. Try googling it. Are you on your own server or using a webhost? Most webhosts provide the ability to create a cron job pretty easily.
0
 
wantabe2Author Commented:
This is on a Windows box using WAP as the web server...
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
wantabe2Author Commented:
WAMP not WAP. I'm using WAMP
0
 
leakim971PluritechnicianCommented:
you can use the MS task scheduler :
http://php.net/manual/en/install.windows.commandline.php
http://msdn.microsoft.com/en-us/library/aa383614(v=vs.85).aspx

with the result from the query you can run the entire script, something like :


<?PHP

include "includes/connect.inc";

$query = "SELECT COUNT(*) FROM INFO WHERE DUE_DATE BETWEEN now() AND (now() - interval 6 day)";
$result = mysql_query($query,$connexion);
$row = mysql_fetch_assoc($result);

if( $row[0] != "0" ) {
   header('Location: EMAIL_EMPLOYEES.php');
}

?>

Open in new window

0
 
wantabe2Author Commented:
What does $connexion refer to?
0
 
leakim971PluritechnicianCommented:
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now