Sometimes I would like to get the amount of results in a query, often I use mysqli_num_rows to do that, example:
$count = mysqli_query($this->db,"SELECT * FROM `test`");
return mysqli_num_rows($count);
With count:
$count = mysqli_query($this->db, "SELECT COUNT(*) as cnt FROM test");
$row = mysqli_fetch_assoc($count);
return $row['cnt'];
Is there any difference between these two ways to get the number of rows returned?