|
Posted by Steve on 02/07/07 09:05
On Tue, 06 Feb 2007 21:49:12 -0800, lorento wrote:
> $ml_collect='SELECT MIN(ml_lopp.loppnum) as minNum, MAX
> (ml_lopp.loppnum) as maxNum FROM ml_lopp LEFT JOIN scfmforening ON
> (scfmforening.scfmnum=ml_lopp.scfmnum) LEFT JOIN ml_newtidplats ON
> (ml_newtidplats.loppnum=ml_lopp.loppnum) ORDER BY date1,
> ml_lopp.loppnum';
>
> $ml_upg=mysql_query($ml_collect);
>
> while ($row = mysql_fetch_object ($ml_upg))
> {
> $min = $row->minNum;
> $max = $row->maxNum;
> }
>
I'd suggest something along the lines of...
$row = mysql_fetch_object ($ml_upg);
$min = $row->minNum;
$max = $row->maxNum;
while ($row = mysql_fetch_object ($ml_upg))
{
$min = ($row->minNum < $min) ? $row->minNum : $min;
$max = ($row->maxNum > $max) ? $row->maxNum : $max;
}
Would work better???
Steve
Navigation:
[Reply to this message]
|