|
|
 |
Re: FN-FORUM loop in php
date posted 25th June 2002 20:04
> how would you echo the following database retrieval in a list until all the
> rows have been echoed?
Hi Rob,
Use a do...while loop
$sql = "Your query here";
$result = mysql_query($sql);
if ($myrow = mysql_fetch_array($result)){
do{
$foo = $myrow['foo'];
$bar = $myrow['bar'];
echo "Foo is : $foo, Bar is : $bar ";
} while($myrow = mysql_fetch_array($result))
}else{
echo "no results returned";
}
Hopethis helps,
Best regards,
Ray
------------------------------
Ray McGinty Information Design
Specialising in design for data-driven websites
e-commerce and design for print.
http://www.rmid.co.uk
|
 |
|