Try changing this:
Code:
//Creating SQL parameter
$curDate2 = "%".$mday."%".$month[0].$month[1].$month[2]."%".$year."%";
$preday = strftime ("%d",$test);
$premonth = strftime ("%B",$test);
$preyear = strftime ("%Y",$test);
$curDateP = "%".$preday."%".$premonth[0].$premonth[1].$premonth[2]."%".$preyear."%";
to this:
Code:
//Creating SQL parameter
$curDate2 = "%".$month[0].$month[1].$month[2]."%".$mday."%".$year."%";
$preday = strftime ("%d",$test);
$premonth = strftime ("%B",$test);
$preyear = strftime ("%Y",$test);
$curDateP = "%".$premonth[0].$premonth[1].$premonth[2]."%".$preday."%".$preyear."%";
The ordering is slightly different. See if that works