1internet Posted November 27, 2012 Share Posted November 27, 2012 I want to be able to search my entire site over all the tables, e.g. restaurants, entertainment, hotels, etc. How is this done? Also what if I wanted to search through more than one clolumn, e.g. title and body, and then further, what if I wanted to rank the ones that contained the search query in the title, ahead of the ones in the body? Link to comment https://forums.phpfreaks.com/topic/271221-sitewide-search-requiring-multiple-tables/ Share on other sites More sharing options...
NomadicJosh Posted November 27, 2012 Share Posted November 27, 2012 To get you started, your query could start as mysql_query( "SHOW TABLES FROM name_of_database" ); or mysql_query( "SELECT * FROM information_schema.`COLUMNS` C WHERE TABLE_SCHEMA = 'YOUR_DATABASE'" ); Link to comment https://forums.phpfreaks.com/topic/271221-sitewide-search-requiring-multiple-tables/#findComment-1395390 Share on other sites More sharing options...
fenway Posted November 30, 2012 Share Posted November 30, 2012 You want a proper fulltext index -- MySQL isn't really good at that -- check out Sphinx. Link to comment https://forums.phpfreaks.com/topic/271221-sitewide-search-requiring-multiple-tables/#findComment-1396367 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.