This is a discussion on MySQL Question 'WHERE MATCH' within the PHP General forums, part of the PHP Programming Forums category; Hi, I have the following table CREATE TABLE `fulltext_sample` ( `copy` text, FULLTEXT KEY `copy` (`copy`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi,
I have the following table CREATE TABLE `fulltext_sample` ( `copy` text, FULLTEXT KEY `copy` (`copy`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; INSERT INTO `fulltext_sample` VALUES ('This is a test to see how mysql works'); Now I do a search for SELECT * FROM fulltext_sample WHERE MATCH(copy) AGAINST('mysql'); and it return 0 results. Can someone please help me with this? Thanks Maz. |
|
|||
|
Hello Maziar,
An example from MySQL.com documentation using a FULLTEXT index and MATCH .... AGAINST Syntax. CREATE TABLE articles ( id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, title VARCHAR(200), body TEXT, FULLTEXT (title,body) ); INSERT INTO articles (title,body) VALUES ('MySQL Tutorial','DBMS stands for DataBase ...'), ('How To Use MySQL Well','After you went through a ...'), ('Optimizing MySQL','In this tutorial we will show ...'), ('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'), ('MySQL vs. YourSQL','In the following database comparison ...'), ('MySQL Security','When configured properly, MySQL ...'); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('database'); : Joseph Melnick JM Web Consultants http://www.jphp.com "Maziar Aflatoun" <maz00@rogers.com> wrote in message news:l9idnfwCjefLQhrfRVn-uA@rogers.com... > Hi, > > I have the following table > > CREATE TABLE `fulltext_sample` ( > `copy` text, > FULLTEXT KEY `copy` (`copy`) > ) ENGINE=MyISAM DEFAULT CHARSET=latin1; > > INSERT INTO `fulltext_sample` VALUES ('This is a test to see how mysql > works'); > > Now I do a search for > SELECT * FROM fulltext_sample WHERE MATCH(copy) AGAINST('mysql'); > and it return 0 results. Can someone please help me with this? > > Thanks > Maz. > > |