Richard Davey wrote:
A few ways to do this:

$total_records = mysql_num_rows($result);

for ($i=0; $i < $total_records; $i++)
{
    $data = mysql_fetch_assoc($result);
    print_r($data);
}
$data will now be an array holding the first set of information. The
print_r line just displays it so you can see it easily.

Instead of a FOR loop you could do a "while" loop checking to see the
end of the $result set, i.e.:

while ($row = mysql_fetch_array($result, MYSQL_NUM))
{
      // do stuff
      print_r($row);
}

AH> <%=rst.fields("whatever").value%>

<?=$data['whatever']?>


I get this error: mysql_num_rows(): supplied argument is not a valid MySQL result resource


Question: Where you have the //do stuff comment, I assume this is where my HTML code will go. But can I put it between the open brackets? I.E:
{
html code
}


?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to