 |
BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6  | This is the forum to discuss the Wrox book Beginning PHP, Apache, MySQLWeb Development by Michael K. Glass, Yann Le Scouarnec, Elizabeth Naramore, Gary Mailer, Jeremy Stolz, Jason Gerner; ISBN: 9780764557446 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

August 14th, 2005, 09:49 AM
|
|
Registered User
|
|
Join Date: Aug 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Bulletin Board system
I got a problem with setup.php in chapter 16. I used the downloaded code, when I run the code, I got message: "The used table type doesn't support FULLTEXT indexes". Here is the code below:
/******* Posts Table *************************************************/
$sql = <<<EOS
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)
)
EOS;
$result = mysql_query($sql);
switch(mysql_errno()) {
case 1050:
break;
case 0:
$sql = "INSERT INTO forum_posts VALUES (NULL, 0, 1, 1, 0, '" .
date("Y-m-d H:i:s", time())."', 0, 'Welcome', 'Welcome " .
"to your new Bulletin Board System. Do not forget to " .
"change your admin password after installation. " .
"Have fun!')";
$result = mysql_query($sql)
or die(mysql_error());
break;
default:
die(mysql_error());
break;
}
$a_tables[] = "forum_posts";
Can anyone give me a guide? Thanks,
Smith.
|
|

November 11th, 2007, 08:12 PM
|
|
Registered User
|
|
Join Date: Nov 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
not sure if you're still here, this thread is a very old one, but the reason why it doesn't work is because the default table type doesn't support FULLTEXT indexes. I think this was introduced in MySQL 5.
I fixed the problem with the following:
Code:
/* Posts Table */
$sql = "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)) ENGINE=MyISAM";
Note at the end of the SQL statement, and before the semi-colon, the line "ENGINE=MyISAM"? You need to use this dbase engine to use FULLTEXT keys.
Hope that helps someone.
|
|
 |