I'm not sure why that's not working, it looks ok to me.
I do mine like this, there may be a better way though.
$sql = "select * from bla";
$result = mysql_query($sql);
$num = mysql_num_rows($result);
for ($i=0; $i<$num; $i++) {
$myrow = mysql_fetch_array($result);
echo "bla";
}