zang8027 Posted March 24, 2010 Share Posted March 24, 2010 I have a table set up like the following: ------------------------- comments_table ------------------------- ID | Comment | picID ----------------------------- 1 | lorum ipsum | 54 2 | lorum ipsum | 36 3 | lorum ipsum | 54 If i wanted to find out how many records had the picID of 54, how could i get that? I want the final result to be like: The total number of records is 2. Which of course i can implant easily into php Quote Link to comment https://forums.phpfreaks.com/topic/196417-sum-of-the-of-fields-in-a-table/ Share on other sites More sharing options...
o3d Posted March 24, 2010 Share Posted March 24, 2010 select count(id) as cnt from comments_table where picID = 54 Quote Link to comment https://forums.phpfreaks.com/topic/196417-sum-of-the-of-fields-in-a-table/#findComment-1031338 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.