I have a problem with the following piece of code.
ClickPHP Code:echo "<br /><b>On Today's Schedule:</b><br />";
$duration = 0;
while ($row = mysql_fetch_array ($result))
{
if ($djname != $row['name'])
// not same name as the last time
{
$programs[] = array('start' => $start, 'end' => $end, 'djname' => $djname);
$djname = $row['name'];
$start = $row['start'];
$end = $row['end'];
$duration = 1;
}
else
{
$end = $row['end'];
$duration += 1;
}
}
if ($duration) $programs[] = array('start' => $start, 'end' => $end, 'djname' => $djname);
// now print out shows
foreach ($programs as $show)
{
echo $show['start'] . ' - ' . $show['end'] . ' : ' . $show['djname'] . '<br />';
}
Ignore the golden table, look at the bottom. Why is it tacking on an empty array at the beginning?






Bookmarks