How to group by and count each item of serialized array?
-
I’m storing a list of items in a serialized array within a field in my database. Each user have this serialized array in own table. I need to count how many user has one item of the serialized array.
For example:
user id | value
123 | a:4:{i:0;s:3:”615“;i:1;s:3:”619“;i:2;s:3:”918“;i:3;s:3:”570“;}
12 | a:4:{i:0;s:3:”23“;i:1;s:3:”615“;i:2;s:3:”918“;}
143 | a:4:{i:0;s:3:”918“;i:1;s:3:”125“;}i need this result:
918 – 3 users have it
615 – 2 users have it
619 – 1 user have it
570 – 1 user have it
125 – 1 user have it
23 – 1 user have itI will be very grateful for your help!!
- This topic was modified 3 years, 4 months ago by .
- This topic was modified 3 years, 4 months ago by .
- This topic was modified 3 years, 4 months ago by .
- This topic was modified 3 years, 4 months ago by .
- This topic was modified 3 years, 4 months ago by .
- This topic was modified 3 years, 4 months ago by .
- This topic was modified 3 years, 4 months ago by .
- This topic was modified 3 years, 4 months ago by .
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘How to group by and count each item of serialized array?’ is closed to new replies.