yandoo Posted April 4, 2008 Share Posted April 4, 2008 Hi there, I need to build a search form that has a simple text field that the user can use to search a table in my database. The drop down options would be used to determine what field in the table you are searching.... Could somebody point me in the direction of a good tutorial or where i can find out how to build this please?? Thanks Link to comment https://forums.phpfreaks.com/topic/99517-search-textfield/ Share on other sites More sharing options...
ToonMariner Posted April 4, 2008 Share Posted April 4, 2008 make it easy for the user - search the fields your self and output results based on which field the search was matched... Link to comment https://forums.phpfreaks.com/topic/99517-search-textfield/#findComment-509116 Share on other sites More sharing options...
gm04030276 Posted April 4, 2008 Share Posted April 4, 2008 Use InnoDB (i think) table format and then add a fulltext index to the fields you want to be able to search. You'll need to find a bit more information on this as its been a while since i did this but something like SELECT *,search FROM `table` WHERE MATCH('text_field_input') AGAINST(`field`) AS `search` ORDER BY `search` DESC; This (should, again, been a while, you might have to play with the syntax) will take your input, match it against a field and display the results from the highest matched percentage to the lowest (out of 1, * by 100 if you want actual percentage to display). Link to comment https://forums.phpfreaks.com/topic/99517-search-textfield/#findComment-509119 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.