One mistake

Marek Kilimajer wrote:

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
}
// wrong: $i = $tmp; // keep this new time for next loop
$i = $row->min; // this is instead of the previos line


        }
    }

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

Reply via email to