Tuesday, February 06, 2007

About FULLTEXT

I am learning "Beginning PHP5 Apache and MySQL Web Development" now.It's really a good book for PHP beginners.If you are just start now, I strongly recommend you to read this book.Very easy to understand, so many examples...www.wrox.com

I am reading chapter 16 - a bulletin board.While I am trying to run the setup.php, a problem jump out... "The used table type doesn't support FULLTEXT indexes".This is the first time I meet this kind MySQL problem.I searched on Google and got the answer.

"This message appears when the database server is configured to use another table type than MyISAM."

original code -
CREATE TABLE forum_posts (
id int(11) NOT NULL auto_increment,
topic_id int(11) NOT NULL default '0',
forum_id int(11) NOT NULL default '0',
author_id int(11) NOT NULL default '0',
update_id int(11) NOT NULL default '0',
date_posted datetime NOT NULL default '0000-00-00 00:00:00',
date_updated datetime NOT NULL default '0000-00-00 00:00:00',
subject varchar(255) NOT NULL default '',
body mediumtext NOT NULL,
PRIMARY KEY (id),
KEY IdxArticle (forum_id,topic_id,author_id,date_posted),
FULLTEXT KEY IdxText (subject,body)
) TYPE=MyISAM //add the red code to correct the mistake.

If you meet the same problem, hope the article can help you.

No comments: