I am a school teacher and I use a couple of scripts that were written for me a few years ago. Their purpose is to select a name from a database in sequential order and then switch to the next name for the next day. Hope I said that right.
School is starting and a few days and I checked my site and the pages that use these scripts are kicking up some errors. I have looked at the problem and tried to find a solution but my lack of knowledge has me stumped. Below I have the errors and the code, can anyone tell me what to fix and how to do it. Assume I know nothing, because I don’t
Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CDT/-5.0/DST' instead in daily/index.php on line 6
Warning: strtotime() [function.strtotime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CDT/-5.0/DST' instead in daily/index.php on line 7
[php]function getName($table = ‘names’, $date = ‘’) {
$date = empty($date) ? date(‘Y-m-d’) : $date;
$day = date(‘z’, strtotime($date));
$x = mysql_query("SELECT * FROM $table ORDER BY id");
$names = array();
while ($n = mysql_fetch_array($x))
$names[] = $n['name'];
for ($x = 0; $x < $day; $x++) {
$fname = array_shift($names);
$names[] = $fname;
}
return $names[1];
}
$male = getName(‘male’);
$female = getName(‘female’);
$manager = getName();[/php]