Hi,
I'm currently developing a video site, and am looking for suggestions for the best way to have a "Related Videos" feature for each video, displaying similar videos from the database based on tag etc.
my current database structure is as follows:
CREATE TABLE `video` (
`video_id` int(11) NOT NULL auto_increment,
`video_title` varchar(255) NOT NULL default '',
`video_desc` text NOT NULL,
`embed_code` text NOT NULL,
`video_timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP,
`video_views` int(11) NOT NULL default '0',
`user_id` int(11) NOT NULL default '0',
`active` int(11) NOT NULL default '0',
`video_thumb` text NOT NULL,
`ip_address` varchar(255) NOT NULL default '',
`video_level` int(1) NOT NULL default '0',
`num_comments` int(11) NOT NULL default '0',
PRIMARY KEY (`video_id`)
)
CREATE TABLE `video_tags` (
`videotag_id` int(11) NOT NULL auto_increment,
`video_id` int(11) NOT NULL default '0',
`tag_name` varchar(255) NOT NULL default '0',
`user_id` int(11) NOT NULL default '0',
`videotag_timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP,
PRIMARY KEY (`videotag_id`)
)
so each video is assigned tags, each tag being placed in the video_tags table with video_id linking them to the video.
could you please advise which would be the best way to display say 6 related videos from the database? these could be random, most viewed results, latest uploaded results etc.
Thanks!