jrws Posted April 13, 2009 Share Posted April 13, 2009 Hi there, Once again I have a question, how or what command would one use to find out how many times something reoccurs in a table? For example if there is a multiple of uid, how do I find out how many a specific uid occurs? Here is an example id uid 1 2 2 2 3 4 4 1 5 6 6 2 And I want to count how many times uid 2 appears, which would be 3 times. Would I use something like SUM or COUNT? Quote Link to comment https://forums.phpfreaks.com/topic/153929-solved-what-function/ Share on other sites More sharing options...
Maq Posted April 13, 2009 Share Posted April 13, 2009 Yes you would need to use COUNT and GROUP BY. Quote Link to comment https://forums.phpfreaks.com/topic/153929-solved-what-function/#findComment-808988 Share on other sites More sharing options...
Mchl Posted April 13, 2009 Share Posted April 13, 2009 Is this a PHP question or MySQL question? Quote Link to comment https://forums.phpfreaks.com/topic/153929-solved-what-function/#findComment-808993 Share on other sites More sharing options...
jrws Posted April 13, 2009 Author Share Posted April 13, 2009 I dunno what it would be counted as, because I am displaying the information via PHP, however I am using a database. I asume the latter, and I now realise I have probably posted in the wrong place. -James- Quote Link to comment https://forums.phpfreaks.com/topic/153929-solved-what-function/#findComment-809022 Share on other sites More sharing options...
Mchl Posted April 13, 2009 Share Posted April 13, 2009 Most likely indeed. You didn't even say you use MySQL Don't worry about it, just take care to post in the right section next time. Maq is pointing you in the right direction. Quote Link to comment https://forums.phpfreaks.com/topic/153929-solved-what-function/#findComment-809028 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.