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 Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.