Page 1 of 1

PHP array count?

Posted: Fri Jan 31, 2003 11:10 am
by mzfp2
hi

im using mysql_fetch_array to get rows of a result array, however how can i count how many rows were returned without having to pasds a seperate count query to mysql?

thanks
M

Posted: Fri Jan 31, 2003 11:28 am
by hob_goblin

Posted: Fri Jan 31, 2003 11:49 am
by DeGauss
or:

$blah=mysql_fetch_array($sql)
$number=count($blah);

Posted: Fri Jan 31, 2003 11:57 am
by volka
$blah=mysql_fetch_array($sql)
$number=count($blah);
counts how many fields one row has.
Use the function hob_goblin pointed you to.

Posted: Fri Jan 31, 2003 3:40 pm
by DeGauss
Oops, yeah.

Sorry!