Making a "repeat region" for a specific variable
Posted: Tue May 10, 2005 12:28 am
What I am trying to accomplish is format a date from a database then have a specific array repeated for all records in the database. I have figured everything out except the repeating part.
Here's the basic code I started with:
Then I added the date formatting, recordset, and connection to database:
So now, rather than using "9" "10" and "11" it will use the values from the database ($evtDay). Only problem is I cant get it to repeat. It will only write the code of line 6 (in the 2nd php code box) one time rather than once for every date entry in the database. Any help would be much appreciated.
Here's the basic code I started with:
Code: Select all
$days = array(
$today=>array(NULL,'calendar-day',NULL,NULL.$today.'</span>'),
9=>array('#','calendar-linked',NULL,NULL.'9'.'</span>'),
10=>array('#','calendar-linked',NULL,NULL.'10'.'</span>'),
11=>array('#','calendar-linked',NULL,NULL.'11'.'</span>'),
);Code: Select all
$evtDate = $row_rsAppearances['Date'];
list ($evtYear, $evtMonth, $evtDay) = explode ("-", $evtDate);
$days = array(
$today=>array(NULL,'calendar-day',NULL,NULL.$today.'</span>'),
$evtDay=>array('#','calendar-linked',NULL,NULL.$evtDay.'</span>'),
);