PHP using count() with array
- by seb
Hi there,
Im trying to get the amount of elements in an array using the count() function, the result is a bit puzzling to me, considere the following example.
Assume that the user ID provided is wrong, and therefore had no matches, wouldnt then the result of the count function be 0? yet it is 1. can you explain to me why?
thanks
$q = mysql_query("select password from users where user_name = '" . $userID . "'");
$check = mysql_fetch_array($q);
$result = count($check);
echo "RESULT:" . $result;