I'd appreciate your help on this please :
I've got a table which logs when an user (id_user) where at an event (meeting, concert..) (id_event) and his score for this event (long story). Here is my table:
CREATE TABLE `Leaderboards` (
`id` mediumint(9) NOT NULL AUTO_INCREMENT,
`id_event` mediumint(8) NOT NULL,
`user_id` mediumint(9) NOT NULL,
`score` smallint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
Now, I'd like to suggest to an user all the users which have been to at least one event in common, and sort it by users which have been to a lot of events in common.
I might have an idea to do it in php after a row request, but is there a smarter way to do it directly through MySQL?
Thank you for your answers!