Re: Need to refine this:

From: Date: Wed, 04 Feb 2004 05:32:55 +0000
Subject: Re: Need to refine this:
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-176759@lists.php.net to get a copy of this message
Jason, > You're tired so you want others to do your work? No ... > Maintain a 'flag' which stores 'previous' value of $mydata-district. If > 'flag' > and $mydata-district differ print $mydata-district and update 'flag'. I cannot declare $temp = $mydata->district; outside while ($mydata so ... ? I'm missing something in my logic. That's why I asked. It wouldn't make sense to declare this twice: while ($mydata = mysql_fetch_object($myquery)) $temp = ""; echo "<table>\n"; while ($mydata = mysql_fetch_object($myquery)) { $temp = $mydata->district; while ($temp <> $mydata->region) { echo "<tr bgcolor=\"#CCCCCC\"><td>$mydata->district</td></tr>\n"; } echo "<tr bgcolor=\"#CCCCCC\"><td>$mydata->city</td> <td>$mydata->place</td> <td>$mydata->meetingtime</td></tr>\n"; } echo "</table>\n";

« previous php.general (#176759) next »