mysql_fetch_array — Fetch a result row as an associative array, a numeric array, or both
http://php.net/mysql_fetch_array
$memarray = mysql_query("SELECT id FROM members") or die ("unable to get info");
$fArray = mysql_fetch_array($memarray);
echo '<pre>';
print_r($fArray);
result would be some thing like this :
Array ( [0] => 23 [id] => 23 )
obviously count($fArray) returns 2
to count all recors
$memarray = mysql_query("SELECT COUNT(id) as count FROM members") or die ("unable to get info");
$fArray = mysql_fetch_assoc($memarray);
echo $fArray['count'];
or
$memarray = mysql_query("SELECT id FROM members") or die ("unable to get info");
echo mysql_num_rows($memarray);
to fetch all your records
while($row = mysql_fetch_assoc($memarray))
{
print_r($row);
}
and I also suggest take look at this notice :
Warning This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQL extension
should be used. See also MySQL: choosing an API guide and related FAQ
for more information. Alternatives to this function include:
mysqli_fetch_array() PDOStatement::fetch()
https://www.php.net/manual/en/mysqli-result.fetch-array.php
https://www.php.net/manual/en/pdostatement.fetch.php
msqli_queryinstead ofmysql_querymysql_*withmysqli_*asmysql_*is deprecated. us3.php.net/manual/en/changelog.mysql.php