Just create a table with a name likeswith a structure like this:
`id` int(11) NOT NULL AUTO_INCREMENT,
`userid` int(11) NOT NULL,
`post_type` varchar(10) NOT NULL,
`post_id` int(11) NOT NULL,
`date` datetime NOT NULL,
PRIMARY KEY (`id`)
, - , , post_type , post_id ().
- , , .
, :
SELECT * FROM `likes` WHERE post_id = 'id' AND post_type = 'activity'
'id' ID.
( , post_type, ).
, , :)