...

View Full Version : Change MySQL Query to Count All Rows



unemployment
01-10-2012, 02:50 AM
Right now I have this query which count the number of partners a user has:



SELECT COUNT(`partner_id`) FROM `partners` WHERE (`user_id` = ${uid} OR `friend_id` = ${uid}) AND `approved` = 1


I need to change this code so it is not specific to any user, but I don't know how. How do I change it to get a list of the counts for all partners?

sunfighter
01-10-2012, 06:30 PM
SELECT COUNT(*) FROM `partners` will return the number of records in a table.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum