The AnimeFanlistings Network Message Board

Enth 3 and MySQL 5.5

Hal · 3 · 2120

Offline Hal

  • Newbie
  • *
    • Posts: 0
  • Sadly, closed. Life\'s more than
    • View Profile
Just yesterday my host upgraded MySQL 5.1 to MySQL 5.5, and just half an hour ago or so I finally got around to learning this after I tried to add a new fanlisting... only to meet an error with mod_setup.php.

The problem is with the TYPE=MyISAM, found between lines 264-278 in Araneae:

Code: [Select]
 // create database if yes
 if( isset( $_POST['createtable'] ) && $_POST['createtable'] == 'yes' ) {
$query = "CREATE TABLE `$dbtable` ( " .
'`email` VARCHAR(64) NOT NULL default "", ' .
'`name` VARCHAR(128) NOT NULL default "", ' .
'`country` VARCHAR(128) NOT NULL default "", ' .
'`url` VARCHAR(255) default NULL, ' .
'`pending` TINYINT(1) NOT NULL default 0, ' .
'`password` VARCHAR(255) NOT NULL default "", ' .
'`showemail` TINYINT(1) NOT NULL default 1, ' .
'`showurl` TINYINT(1) NOT NULL default 1, ' .
'`added` date default NULL, ' .
'PRIMARY KEY( email ), ' .
'FULLTEXT( email, name, country, url ) ' .
') TYPE=MyISAM;';

It's outdated for MySQL 5.5 and will prevent you from creating new fanlistings tables in your database. I looked it up on MySQL.com and it can be fixed by changing TYPE=MyISAM to ENGINE = MYSIAM, like so:

Code: [Select]
 // create database if yes
 if( isset( $_POST['createtable'] ) && $_POST['createtable'] == 'yes' ) {
$query = "CREATE TABLE `$dbtable` ( " .
'`email` VARCHAR(64) NOT NULL default "", ' .
'`name` VARCHAR(128) NOT NULL default "", ' .
'`country` VARCHAR(128) NOT NULL default "", ' .
'`url` VARCHAR(255) default NULL, ' .
'`pending` TINYINT(1) NOT NULL default 0, ' .
'`password` VARCHAR(255) NOT NULL default "", ' .
'`showemail` TINYINT(1) NOT NULL default 1, ' .
'`showurl` TINYINT(1) NOT NULL default 1, ' .
'`added` date default NULL, ' .
'PRIMARY KEY( email ), ' .
'FULLTEXT( email, name, country, url ) ' .
') ENGINE = MYISAM;';

I made a mod copy and updated my file with that code, uploaded it, and it didn't break Enthusiast or my fanlistings and I got to add my new fanlisting - so I'd say it works. :)

I'll make updates if I notice anything else (though, if anybody else is having Enth/MySQL 5.5 troubles or solutions, please feel free to share).
« Last Edit: May 05, 2012, 02:27:54 AM by Hal »


Offline Masao

  • TAFL Staff Alumni
  • *
    • Posts: 0
    • View Profile
    • http://shinshoku.net
My host is running on 5.2.5 and I don't have any issues, but I can't test this out myself yet, until they upgrade. But thanks for the heads up about this issue though!
[font=\'Courier New\']Prototype boy, with only ideals for tomorrow
You won\'t become a lovely story to be passed down.[/font]

Songs (FUC) | [url=\"http://www3


Offline Hal

  • Newbie
  • *
    • Posts: 0
  • Sadly, closed. Life\'s more than
    • View Profile
You're welcome, Masao. (You're so lucky you don't have to do all this updating yet.) :)

I do come bearing another update, though: this time on the mod_owned.php file. It's the same problem/solution with the TYPE=MyISAM as the above, only this one prevents you from enabling affiliates (say, on a brand new fanlisting).

On the mod_owned.php file, between lines 895-905 in Araneae:

Code: [Select]
  // add table
  $afftable = $table . '_affiliates';
  $query = "CREATE TABLE `$afftable` (" .
 "`affiliateid` int(5) NOT NULL auto_increment, " .
 "`url` varchar(255) NOT NULL default '', " .
 "`title` varchar(255) NOT NULL default '', " .
 "`imagefile` varchar(255) default NULL, " .
 "`email` varchar(255) NOT NULL default '', " .
 "`added` DATE NOT NULL default '0000-00-00', " .
 "PRIMARY KEY( affiliateid ) " .
 ") TYPE=MyISAM AUTO_INCREMENT=1";

Needs to become:

Code: [Select]
 // add table
  $afftable = $table . '_affiliates';
  $query = "CREATE TABLE `$afftable` (" .
 "`affiliateid` int(5) NOT NULL auto_increment, " .
 "`url` varchar(255) NOT NULL default '', " .
 "`title` varchar(255) NOT NULL default '', " .
 "`imagefile` varchar(255) default NULL, " .
 "`email` varchar(255) NOT NULL default '', " .
 "`added` DATE NOT NULL default '0000-00-00', " .
 "PRIMARY KEY( affiliateid ) " .
 ") ENGINE=MyISAM AUTO_INCREMENT=1";

I think I'll just look for anymore TYPE=MyISAM in the files and make a list of where's if I find any, because they will all - no doubt - need to become ENGINE=MyISAM to be MySQL 5.5 compliant...

PS: I noticed on my last post, I wrote ENGINE = MYSIAM with spaces and all uppercase, and in this one without. As I now happen to be using both, as of right now, it appears it doesn't matter which one you use; the last one I ripped right from the MySQL site (so, you know it'd work), and this one I just changed Type to Engine since I knew immediately that's what needed to be done and it works fine, too.
« Last Edit: June 04, 2012, 06:51:22 PM by Hal »