• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 234
  • 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

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