Connecting Tech Pros Worldwide Help | Site Map

MultiDimensional Array Count

Newbie
 
Join Date: Oct 2007
Posts: 3
#1: 2 Weeks Ago
This is how my db structure looks, i have around 350 rows like this one below each with a different number of comment_list and likes from friends.


All i want is a query that counts how many times each variable comes up in the db.

For example if we ran the query in this script we would get:

1.) 65653171 (3 Times)
2.) 67418530 (1 Time )

etc...

Any Ideas???


Expand|Select|Wrap|Line Numbers
  1.  [0] => Array
  2.  
  3.                 (
  4.                     [viewer_id] => 65653171
  5.                     [source_id] => 65653171
  6.                     [actor_id] => 65653171
  7.                     [comments] => Array
  8.  
  9.                         (
  10.  
  11.                             [comment_list] => Array
  12.                                 (
  13.                                     [0] => Array
  14.                                         (
  15.                                             [fromid] => 67418530
  16.                                         )
  17.                                     [1] => Array
  18.                                         (
  19.                                             [fromid] => 108832181
  20.                                         )
  21.                                 )
  22.                         )
  23.  
  24.                     [likes] => Array
  25.  
  26.                        (
  27.                             [friends] => Array
  28.                             (
  29.                                 [0] => 58579401
  30.                                 [1] => 55125266
  31.                                 [2] => 57449386
  32.                                 [3] => 60906602
  33.                                 )
  34.                             )
  35.                         )
  36.  
code green's Avatar
Expert
 
Join Date: Mar 2007
Location: England
Posts: 1,076
#2: 2 Weeks Ago

re: MultiDimensional Array Count


Quote:
Any Ideas
Not really,I don't understand. Maybe the bold text is is too distracting.
Quote:
This is how my db structure looks
You have posted a 2d array
Quote:
All i want is a query that counts how many times each variable comes up in the db.
Where are the variables? And why would you want to count variables?
Reply