For example:
// GET ALL ROWS
$get_rows = $sql->query("SELECT expire,date_original,date, FROM table");
$gr = $get_rows->fetch_rows;
Then work with the results…
$expired = count($gr->expire == 0);
$active = count($gr->expire == 1);
$reposted = count($gr->date_original != date);
Or something to that effect?
Generally this isn’t really a good idea, especially if you have more than a million records.
And in order to perform the count(), you need to go through each record and understand the information. If you have a few rows, this doesn’t matter, but when the records get large, you are better off, issuing the correct count sql.
You are better off writing a SQL like this:
You can still apply conditions, but if you have enough resources to handle the amount of records you are retrieving, then use the above solution, but when you are talking about large enterprise amount of data, S