I store tags in 255 varchar area, like this type;
",keyword1,keyword2,keyword3,key word 324,",keyword1234,
(keyword must start and end comma (commakeyword123comma))
-
I can find a keyword3 like this sql query;
select * from table where keyword like = '%,keyword3,%'
CREATE TABLE IF NOT EXISTS `table1` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`tags` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
FULLTEXT KEY `tags` (`tags`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=2242 ;
INSERT INTO `table1` (`id`, `tags`) VALUES
(2222, ',keyword,'),
(2223, ',word is not big,'),
(2224, ',keyword3,'),
(2225, ',my keys,'),
(2226, ',hello,keyword3,thanks,'),
(2227, ',hello,thanks,keyword3,'),
(2228, ',keyword3,hello,thanks,'),
(2239, ',keyword3 but dont find,'),
(2240, ',dont find keyword3,'),
(2241, ',dont keyword3 find,');
(returns 2224,2226,2227,2228)
-
I must change this like command for FULL TEXT SEARCH.
select * from table1 where match (tags) against (",keyword3," in boolean mode)
sql command find 2239,2240,2241 but i dont want to find %keyword3% or keyword3
ideas to find only ,keyword3, ?
,keyword3,
thank you