While loops to build an array
| From: | S.D.Price | Date: | Tue, 30 Nov 2004 15:57:41 +0000 |
| Subject: | While loops to build an array | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-25091@lists.php.net to get a copy of this message | ||
Hi, I wonder if you could help. I am trying to build a php based
calendar for a news blog. The calendar should create hyperlinks directly
to a news story. However in order to do this I need to create a $days
array which takes the date value of the story submitted and the id of
the story and creates a dynamic link.
Howver I am finding it difficult to generate the array using a while
loop - do you know a better way?.
if (mysql_num_rows($result3) > 0) {
$days = array(
while ($row = mysql_fetch_array($result3)) {
date(j,
$row3['entry_date'])=>array($row3['newsid']),;
}
);
}
else {
echo "<p>The array has not been built.</p>";
}
echo generate_calendar($year, $month, $days);
Thanks
Steven