How to group results from query, in this way:
Posted: Mon Jun 03, 2002 1:51 pm
Hi.
Having 10 database cols, in wich could have (or not) any letter, from A to J.
I need to get how many i have from each letter.
i.e: if it would be like this: A - A - C - x -D - A - E - J - E - A
(x means there's no entry).
So, i would have 4-A, 2-E, 1-C, ... ...
Using array_count_values() i get the result above (not ordered), but i need to now wich one is the letter that has "more votes"...
I looked for a function, but can't find it... and i'm stuck... can't find a way to do it...
So, my request for help is:
How can i find the "most voted" letter, so i can use it?
Thanks.
Having 10 database cols, in wich could have (or not) any letter, from A to J.
I need to get how many i have from each letter.
i.e: if it would be like this: A - A - C - x -D - A - E - J - E - A
(x means there's no entry).
So, i would have 4-A, 2-E, 1-C, ... ...
Using array_count_values() i get the result above (not ordered), but i need to now wich one is the letter that has "more votes"...
I looked for a function, but can't find it... and i'm stuck... can't find a way to do it...
So, my request for help is:
How can i find the "most voted" letter, so i can use it?
Thanks.