I seem to be having a problem making functions, as the last time I tried this, I got the same errors. However, then I just did it differently... but in this situation, I need functions!
This is my code:
<?php
require_once('../../Connections/DB_tests.php');
$today = date("Y-m-d");
$start = '2004-01-12';
$end=strtotime('jan 1 1970');
while ($end<=$today) {
echo "<br>Start ".$start;
$end = date('Y-m-d (D)', strtotime($start ."+ 6 days"));
echo "<br>End ".$end;
get_calls($start, $end);
$start=date('Y-m-d (D)', strtotime($end ."+ 1 day"));
$i=$i+1;
}
?>
When I run this, I get these errors:
Notice: Undefined variable: database_DB_tests in C:\Web\tstadm\adm\Stats\test.php on line 13
Notice: Undefined variable: DB_tests in C:\Web\tstadm\adm\Stats\test.php on line 13
Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in C:\Web\tstadm\adm\Stats\test.php on line 13
Notice: Undefined variable: DB_tests in C:\Web\tstadm\adm\Stats\test.php on line 15
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in C:\Web\tstadm\adm\Stats\test.php on line 15
Does anybody have any ideas what I'm doing wrong?