View Single Post
Old 02-10-2005, 02:20 PM  
calmlikeabomb
Confirmed User
 
calmlikeabomb's Avatar
 
Join Date: May 2004
Location: SW Palm Bay, Florida
Posts: 1,323
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......
__________________
subarus.
calmlikeabomb is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote