$query = "SELECT * FROM table"; $result = mysql_query($query, $db); $all = mysql_fetch_assoc($result); echo mysql_num_rows($result) . ":" . count($all);
It returns
2063:7
I haven't used count before, so I'm not 100% sure apart from the columns of the table. It's late and I can go crazy.
Here is another example of what is happening:
$result = mysql_query($query, $db); echo "Rows: " . mysql_num_rows($result) . " <BR />"; $player_array = mysql_fetch_assoc($result); echo "<pre>"; print_r($player_array); echo "</pre>";
What outputs:
Rows: 9 Array ( [playerID] => 10000030 )
TL DR: I am sending requests that return multiple rows, but fetch_array gives me a small fraction of these rows in the resulting array.
source share