Re: query question

From: Date: Thu, 14 Nov 2002 18:30:26 +0000
Subject: Re: query question
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-124467@lists.php.net to get a copy of this message
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
}


« previous php.general (#124467) next »