Y'know, this is exactly the sort of syntax I've always wondered about; why is it so common? Literally from my first PHP programming experience I've written
$result=__query(...);
$numrows = __num_rows($result);
if($numrows)
{ for($i=0; $i<$numrows; $i++)
{ $row = __fetch_array($result);
// Do stuff with $i and $row
}
}
else
{ // No results, do something else.
}
And I've never understood why this isn't the norm. Could someone care to enlighten me, or is it just what I suspect: a spurious habit?