Jump to content


Photo

"The used table type doesn't support FULLTEXT indexes"


  • Please log in to reply
4 replies to this topic

#1 newbreed65

newbreed65

    Advanced Member

  • Members
  • PipPipPip
  • 44 posts
  • LocationCheshire, England

Posted 12 November 2008 - 02:21 PM

Hi everyone
I’m working through a php, mysql and apache book for beginners and I’m up to a chapter were I’m going to make a CMS. The problem is when I try adding the tables I’ve been asked to I get the message “The used table type doesn't support FULLTEXT indexes”. I have done abit of research and one things that I have found is that the tables should be MyiSAM which from what I read they already are by default …am I missing something?????

Heres the sample code to add the tables that I use

<?php
require_once 'conn.php';

$sql = <<<EOS
CREATE TABLE IF NOT EXISTS cms_access_levels (
  access_lvl tinyint(4) NOT NULL auto_increment,
  access_name varchar(50) NOT NULL default '',
  PRIMARY KEY (access_lvl)
)
EOS;
$result = mysql_query($sql) 
  or die(mysql_error());

$sql = "INSERT IGNORE INTO cms_access_levels " .
       "VALUES (1,'User'), " .
       "(2,'Moderator'), " .
       "(3,'Administrator')";
$result = mysql_query($sql) 
  or die(mysql_error());

$sql = <<<EOS
CREATE TABLE IF NOT EXISTS cms_articles (
  article_id int(11) NOT NULL auto_increment,
  author_id int(11) NOT NULL default '0',
  is_published tinyint(1) NOT NULL default '0',
  date_submitted datetime NOT NULL default '0000-00-00 00:00:00',
  date_published datetime NOT NULL default '0000-00-00 00:00:00',
  title varchar(255) NOT NULL default '',
  body mediumtext NOT NULL,
  PRIMARY KEY (article_id),
  KEY IdxArticle (author_id,date_submitted),
  FULLTEXT KEY IdxText (title,body)
)
EOS;
$result = mysql_query($sql) 
  or die(mysql_error());

$sql = <<<EOS
CREATE TABLE IF NOT EXISTS cms_comments (
  comment_id int(11) NOT NULL auto_increment,
  article_id int(11) NOT NULL default '0',
  comment_date datetime NOT NULL default '0000-00-00 00:00:00',
  comment_user int(11) NOT NULL default '0',
  comment text NOT NULL,
  PRIMARY KEY (comment_id),
  KEY IdxComment (article_id)
)
EOS;
$result = mysql_query($sql) 
  or die(mysql_error());

$sql = <<<EOS
CREATE TABLE IF NOT EXISTS cms_users (
  user_id int(11) NOT NULL auto_increment,
  email varchar(255) NOT NULL default '',
  passwd varchar(50) NOT NULL default '',
  name varchar(100) NOT NULL default '',
  access_lvl tinyint(4) NOT NULL default '1',
  PRIMARY KEY (user_id),
  UNIQUE KEY uniq_email (email)
)
EOS;
$result = mysql_query($sql) 
  or die(mysql_error());

$adminemail = "admin@yoursite.com";
$adminpass = "admin";
$adminname = "Admin";

$sql = "INSERT IGNORE INTO cms_users " .
       "VALUES (NULL, '$adminemail', '$adminpass', '$adminname', 3)";
$result = mysql_query($sql) 
  or die(mysql_error());

echo "<html><head><title>CMS Tables Created</title></head><body>";
echo "CMS Tables created. Here is your initial login information:\n";
echo "<ul><li><strong>login</strong>: " . $adminemail . "</li>\n";
echo "<li><strong>password</strong>: " . $adminpass . "</li></ul>\n";
echo "<a href=\"login.php\">Login</a> to the site now.";
echo "</body></html>"
?>


#2 fenway

fenway

    MySQL Si-Fu / PHP Resident Alien

  • Moderators
  • 16,193 posts
  • LocationToronto, ON

Posted 12 November 2008 - 03:23 PM

No longer the default as of version 5.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#3 corbin

corbin

    Advanced Member

  • Staff Alumni
  • 8,129 posts

Posted 12 November 2008 - 06:11 PM

You can make a table a certain engine type.



CREATE TABLE tbl (
/*blah*/
) ENGINE=MyISAM;
Why doesn't anyone ever say hi, hey, or whad up world?

#4 newbreed65

newbreed65

    Advanced Member

  • Members
  • PipPipPip
  • 44 posts
  • LocationCheshire, England

Posted 12 November 2008 - 06:59 PM

thank you corbin! :-)

Ive read how MyISAM is surposed to be faster etc but would the people with alot more MySQL experiance recommend using it as the defualt engine for tables or is it better to just leave it to table that need it?

#5 corbin

corbin

    Advanced Member

  • Staff Alumni
  • 8,129 posts

Posted 12 November 2008 - 07:28 PM

MyISAM is faster for selecting in general, but it does have it's downsides.


MyISAM retrieves more quickly, but changes/adds more slowly.


With InnoDB, when part of a table is updated, only the effected rows are changed, but with MyISAM, the entire table is locked.



Just google "MyISAM v InnoDB" if you want to know more or get a better explanation.
Why doesn't anyone ever say hi, hey, or whad up world?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com