MySQL Question 'WHERE MATCH'

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; ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-16-2005
Maziar Aflatoun
 
Posts: n/a
Default MySQL Question 'WHERE MATCH'

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.


Reply With Quote
  #2 (permalink)  
Old 05-18-2005
Joseph Melnick
 
Posts: n/a
Default Re: MySQL Question 'WHERE MATCH'

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.
>
>



Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:19 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0