npsari Posted March 2, 2007 Share Posted March 2, 2007 Hi I created a database Then I created a table with the following rows Writer: StoryTittle: StoryBody: Tags: Writer Email: I want users to search for keywords in the "Tags" row only And when the kewords match All the 5 details of the writer come up Is there a straight forward code for this, can anybody show me the way Link to comment https://forums.phpfreaks.com/topic/40787-search-tags-only-in-a-database/ Share on other sites More sharing options...
bwochinski Posted March 2, 2007 Share Posted March 2, 2007 I'd recommend Fulltext searching. You'll need to create a fulltext index on the "tags" column. Tutorial here: http://www.phpfreaks.com/tutorials/129/0.php The SQL is something like this: SELECT *, MATCH(tags) AGAINST ($search) AS score FROM stories_table WHERE MATCH(tags) AGAINST($search) ORDER BY score DESC Link to comment https://forums.phpfreaks.com/topic/40787-search-tags-only-in-a-database/#findComment-197467 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.