Untested, but should work Steve Buehler wrote:
function getstart_end(){ $result=mysql_query("SELECT * FROM aplayabletimes ORDER BY min"); while(($row=mysql_fetch_object($result))){ if(!$i){ echo $row->min . " - ";
$i=$row->min;
}else{
$tmp = $i + 5 minutes // add 5 minutes to $i, implement it yourself if($tmp != $row->min) { // there is a gap echo $i ."<br>\n"; // print previous time as end echo $row->min . " - "; // print this time as new start } $i = $tmp; // keep this new time for next loop
} }
echo $row->min ."<br>\n"; // print last row
}
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php