From: "Chris Dowell" <[EMAIL PROTECTED]>
Or alternatively
$result = mysql_query("SELECT * FROM tablename");
if (mysql_num_rows($result))
{
while ($row = mysql_fetch_row($result))
{
// display results
}
}
else echo "No results";
bah... you're wasting precious resources on a mysql_num_rows call... ;)
$result = mysql_query(" ... ");
if($row = mysql_fetch_assoc($result))
{
do{
//display results
}while($row=mysql_fetch_assoc($result));
}
else
{ echo 'No results'; }
Millions ways to do it. :)
---John Holmes...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php