Quote:
|
Originally Posted by Zester
I need a simply SQL query to get the amount of 'Approved' galleries I have in database, and the amount of 'Pending' galleries I have in database
what do I use?
it should be something like this:
SELECT * count(status='Approved') approved, count(status='Pending') pending
FROM galleries
what do you say?
|
Code:
$approvedquery = "SELECT * FROM galleries WHERE status='Approved'";
$approved = @mysql_results($approvedquery);
$numapproved = mysql_num_rows($approved);
There are currently $numapproved approved galleries.
That would be the correct way to do it......