Re: query question
| From: | Marek Kilimajer | 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:$i = $row->min; // this is instead of the previos linefunction 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;$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}else{
echo $row->min ."<br>\n"; // print last row} }}