Hopefully someone can help me out with this. Its about to drive me crazy.
Warning: mktime() expects parameter 6 to be long, string given in cron_reminders.php on line 45
(Repeats ~25,000 times)
Line 45 is in bold:
$remind_after_this_many_days = $reminders['days']; // this is taken from reminders db
$remind_on_this_day = $day + $remind_after_this_many_days; // this is the 'day' to execute the reminder
$reminder_unix = mktime(0,0,0,$month,$remind_on_this_day,$year); // get the timestamp for the 'day'
$reminder_date = date("Y-m-d", $reminder_unix); // get the date format for the 'day';
// if the reminder_date is today, then continue
if ($reminder_date == date("Y-m-d")) {
I don't know why $year isn't working. If I echo $year (this part of the script is in a while), I get the year format from the mysql database, which the column containing the year is in mysql datetime format.
The only place the value of $year exists is in an included file, and the section it is mentioned in is:
###############################################
converts mysql date to user friendly
example "2004-07-25" coverts to 07/25/2004
###############################################
function misc_mysqldate2friendly($date, $delim='/')
{
if (preg_match("'[\d]{4}-[\d]{2}-[\d]{2}\s[\d]{2}:[\d]{2}:[\d]{2}'",$date)) list($date, $time) = explode(" ", $date);
$time = " ".$time;
if ($date == '') return '';
else {
list($year, $month, $day) = explode("-", $date);
return "${month}${delim}${day}${delim}${year}${time}";
}
}
###############################################
converts mysql date to user friendly
example "2004-07-25" coverts to 07/25/2004
###############################################
function misc_friendly2mysqldate($date)
{
if ($date == '' || $date <=0) return '';
else {
list($month, $day, $year) = preg_split("'[-.\/\s^@*_\%#]'", $date);
$thedate = $year .'-'. str_pad($month, 2, "0", STR_PAD_LEFT) .'-'. str_pad($day, 2, "0", STR_PAD_LEFT);
return $thedate;
}
}
Could the problem be with parameter 5, and PHP thinks its 6?
Agh, what a nightmare.