Code: Select all
select *, MATCH (title, about) AGAINST ('socks') AS score from gentv_videos where MATCH (title, about) AGAINST ('socks')Code: Select all
select *, MATCH (title, about) AGAINST ('socks') AS score from gentv_podcasts where MATCH (title, about) AGAINST ('socks')Here's the table structures:
Code: Select all
CREATE TABLE `gentv_videos` (
`id` int(10) NOT NULL auto_increment,
`date_entered` datetime NOT NULL default '0000-00-00 00:00:00',
`title` text NOT NULL,
`about` text NOT NULL,
`file` text NOT NULL,
`thumb` text NOT NULL,
`speaker_id` int(10) NOT NULL default '0',
`cat_id` int(10) NOT NULL default '0',
PRIMARY KEY (`id`),
FULLTEXT KEY `search` (`title`,`about`)
) ENGINE=MyISAM;
INSERT INTO `gentv_videos` (`id`, `date_entered`, `title`, `about`, `file`, `thumb`, `speaker_id`, `cat_id`) VALUES (1, '2008-01-09 16:07:16', 'Test Video', 'This video rocks my socks!', 'test.flv', '', 1, 1);Code: Select all
CREATE TABLE `gentv_podcasts` (
`id` int(10) NOT NULL auto_increment,
`date_entered` datetime NOT NULL default '0000-00-00 00:00:00',
`title` text NOT NULL,
`about` text NOT NULL,
`file` text NOT NULL,
`thumb` text NOT NULL,
`speaker_id` int(10) NOT NULL default '0',
`cat_id` int(10) NOT NULL default '0',
PRIMARY KEY (`id`),
FULLTEXT KEY `search` (`title`,`about`)
) ENGINE=MyISAM;
INSERT INTO `gentv_podcasts` (`id`, `date_entered`, `title`, `about`, `file`, `thumb`, `speaker_id`, `cat_id`) VALUES (1, '2008-01-10 14:38:45', 'Test Podcast', 'This podcast rocks my socks!', 'test.mp3', '', 1, 1);