Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 14th, 2005, 09:49 AM
Registered User
 
Join Date: Aug 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.


Reply With Quote
  #2 (permalink)  
Old November 11th, 2007, 08:12 PM
Registered User
 
Join Date: Nov 2007
Location: , , Australia.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.

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 On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch 16 Bulletin Board Code Problem bigkevracer BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 2 March 10th, 2008 02:52 PM
PHPnuke and Bulletin? Arucard Pro PHP 1 November 22nd, 2005 02:24 PM
bulletin board in the book not correct yatishjain BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 February 12th, 2005 10:31 AM
creating a bulletin board system djfranknitti Beginning PHP 1 October 27th, 2004 08:00 AM
bulletin board allang Classic ASP Databases 2 May 24th, 2004 07:40 AM



All times are GMT -4. The time now is 02:30 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.