Hi,
Even after reading the appropriate documentation, I still don't understand what creating a fulltext index does, why i'm supposed to do it, and how it affects my table...
My table is setup with the following columns: auto_id, name, parent, text
I wish to have a search box that will search my text column in the database for the keywords that were input. However, I'm getting errors (see below) with the following query:
$sql = "SELECT * FROM nav_and_content
WHERE MATCH (name, text) AGAINST ('$keywords');";
the .php page:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/andersst/public_html/yumyumbakeshops/search.php on line 13
the query window in phpmyadmin:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '$sql = "SELECT * FROM nav_and_content
WHERE MATCH (name,text) AGAINST ('donut' at line 1
What do I have to do in order to initiate the fulltext in my db? I'm afraid that if I run the command below the table will only contain the data that existed in the database at that time and will not be updated when new records are added. Is this true?:
ALTER TABLE nav_and_content ADD INDEX name_text (name, text)
In other words, if I add more records to the database, will the indexed table automatically update with new information?
Your help is much appreciated.
Thanks,