I 1000+ have rows of SQL data that look like the followinng
umeta_id | user_id | meta_key | meta_value
433369 | 44 | all_contests | a:1:{s:12:"all_contests";a:2:{i:5011;a:1:{s:7:"entries";i:3;}i:8722;a:1:{s:7:"entries";i:3;}}}
433368 | 63 | all_contests | a:1:{s:12:"all_contests";a:2:{i:5032;a:1:{s:7:"entries";i:3;}i:8724;a:1:{s:7:"entries";i:3;}}}
When you unserialize one of those values you get an array like the following:
Array
(
[all_contests] => Array
(
[5011] => Array
(
[entries] => 3
)
[8722] => Array
(
[entries] => 3
)
)
)
I am trying to create a leaderboard out of all the users for a given contest id. The "all_contests" key holds an array keyed by the ids of all the contests the user signs up for. Inside that is the entries for the given contest.
The query needs to look at all the rows containing 'all_contests' keys and find the 10 highest entries values for a given contest id.
I'm not even sure that it is possible to reliably search inside of a piece of serialized data the way that I'm looking to.