added nagging

This commit is contained in:
oyvinbak committed 2011-03-04 12:14:27 +01:00
1 parent 0613f1c952
commit edf3ab07ba
2 files changed
+43

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
<?php
require '../inside/credentials-sample.php';
$str = getDSN();
preg_match('|([^:]+)://([^:]+):([^@]+)@([^/]+)/(.+)|', $str, $output);
list($str, $driver, $user_name, $password, $host_name, $db_name) = $output;
if(!mysql_connect($host_name, $user_name, $password)) die("error connecting to db");
if(!mysql_select_db($db_name)) die('error selecting databse');
+31
View File
@@ -0,0 +1,31 @@
<?php
require 'db.php';
$res = mysql_query("SELECT * FROM `din_division` WHERE `updated` IS NULL or `updated` + INTERVAL 90 DAY < now()");
while($row = mysql_fetch_assoc($res))
{
$time = strtotime($row['updated']);
$diff = $time - time();
$diff /= 60 * 60 * 24;
$diff = round($diff);
var_dump($row);
if($diff == 0)
{
}
else if($diff == 7)
{
}
else if($diff == 14)
{
}
else if($diff == 21)
{
}
}