Tuesday, April 21, 2009

Do While Loops

$query = "SELECT * FROM table";
$result = mysql_query($query)
or die ("Couldn't execute query.");

while ($row = mysql_fetch_array($result))
{
extract($row);

echo "$variable";
}

$numrows = mysql_num_rows($result);
if ($numrows == 0) {
echo "No recordsare currently available. ";
}

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...
Web Design & Marketing - Click and get an instant quote on your project