|
RE: date - weekdays
ok, there is nothing "inbuilt" to do this. is the weekday in your table stored as just an integer? If so, you're right, this won't work. I had assumed that any date information in your DB would be stored as either date, datetime, or timestamp.
try using this
function getWeekday($iWeekdayId)
{
$arrWeekday = array(
[0] => "SUNDAY",
[1] => "MONDAY",
[2] => "TUESDAY",
[3] => "WEDNESDAY",
[4] => "THURSDAY",
[5] => "FRIDAY",
[6] => "SATURDAY"
);
return $arrWeekday[$iWeekdayId];
}
you may want to add in error checking to make sure that $iWeekdayId > 0 and <= 6
p.
|