lilwing Posted August 21, 2007 Share Posted August 21, 2007 using the source from the tutorial on this website, i have attempted to make a search for a table on one of my mysql databases. it returns "Can't find FULLTEXT index matching the column list" not sure what it means, i googled for it and searched from problems, i can't find the problem! <html> <head><title>Search</title></head> <body> <?php //vars for host username password db table and all that junk // Full-Text Search Example // Conect to the database. $cnx = mysql_connect($host, $username, $password) or die ("Could not connect"); mysql_select_db($db, $cnx) or die (mysql_error()); // Create the search function: function searchForm() { // Re-usable form // variable setup for the form. $searchwords = (isset($_GET['words']) ? htmlspecialchars(stripslashes($_REQUEST['words'])) : ''); $normal = (($_GET['mode'] == 'normal') ? ' selected="selected"' : '' ); $boolean = (($_GET['mode'] == 'boolean') ? ' selected="selected"' : '' ); echo '<form method="get" action="'.$_SERVER['PHP_SELF'].'">'; echo '<input type="hidden" name="cmd" value="search" />'; echo 'Search for: <input type="text" name="words" value="'.$searchwords.'" /> '; echo 'Mode: '; echo '<select name="mode">'; echo '<option value="normal"'.$normal.'>Normal</option>'; echo '<option value="boolean"'.$boolean.'>Boolean</option>'; echo '</select> '; echo '<input type="submit" value="Search" />'; echo '</form>'; } // Create the navigation switch $cmd = (isset($_GET['cmd']) ? $_GET['cmd'] : ''); switch($cmd) { default: echo '<h1>Search Database!</h1>'; searchForm(); break; case "search": searchForm(); echo '<h3>Search Results:</h3><br />'; $searchstring = mysql_escape_string($_GET['words']); switch($_GET['mode']) { case "normal": $sql = "SELECT id, updated_by, updated_on, pagecontent, //these are in my database MATCH(updated_on, updated_by, pagecontent) //i think the problem is in this switch AGAINST ('$searchstring') AS score FROM $table WHERE MATCH(updated_by, updated_on, pagecontent) AGAINST ('$searchstring') ORDER BY score DESC"; break; case "boolean": $sql = "SELECT id, updated_by, updated_on, pagecontent, MATCH(updated_on, updated_by, pagecontent) AGAINST ('$searchstring' IN BOOLEAN MODE) AS score FROM $table WHERE MATCH(updated_on, updated_by, pagecontent) AGAINST ('$searchstring' IN BOOLEAN MODE) ORDER BY score DESC"; break; } // echo $sql; $result = mysql_query($sql) or die (mysql_error()); while($row = mysql_fetch_object($result)) { echo '<strong>Date created: '.stripslashes(htmlspecialchars($row->updated_on)).'</strong><br />'; echo '<p>'.stripslashes(htmlspecialchars($row->pagecontent)).'</p>'; echo '<hr size="1" />'; } break; } ?> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/65998-search-returns-cant-find-fulltext-index-matching-the-column-list/ Share on other sites More sharing options...
lemmin Posted August 21, 2007 Share Posted August 21, 2007 I typed your error into google and this was the first result: http://www.iwebsupport.com/know/article.php?id=004 I don't know if that is the specific source you are using, but it mentions that you need to have a field in your database called "fulltext." Quote Link to comment https://forums.phpfreaks.com/topic/65998-search-returns-cant-find-fulltext-index-matching-the-column-list/#findComment-330010 Share on other sites More sharing options...
lilwing Posted August 21, 2007 Author Share Posted August 21, 2007 okay, it doesn't return the error anymore... but it still doesn't display anything from the table. Quote Link to comment https://forums.phpfreaks.com/topic/65998-search-returns-cant-find-fulltext-index-matching-the-column-list/#findComment-330020 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.