I got a problem Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 141954624 bytes) when to count all of row mysql table
$query = $db->query("SELECT * FROM table");
$count = $db->num_rows($query);
echo $count;
Total rows about 17k and I got Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 141954624 bytes). Let me know, how to fix it.
You could change your SQL query to…
Then you don’t have to load such a large recordset to just then use a row counting function to get the number of rows.