Slow Breakdown of eFiction 3.5.3 update.php Code [2010/10/08] dbnumrows(dbquery("SHOW INDEX FROM ".TABLEPREFIX."fanfiction_inseries WHERE Key_name = 'seriesid'")); dbquery("alter table ".TABLEPREFIX."fanfiction_inseries drop index seriesid;"); dbnumrows(dbquery("SHOW INDEX FROM ".TABLEPREFIX."fanfiction_inseries WHERE Key_name = 'inorder'")); dbquery("alter table ".TABLEPREFIX."fanfiction_inseries drop index inorder;"); dbquery("alter table ".TABLEPREFIX."fanfiction_inseries add index (seriesid,inorder);"); dbnumrows(dbquery("SHOW INDEX FROM ".TABLEPREFIX."fanfiction_inseries WHERE Key_name = 'sid'")); dbquery("alter table ".TABLEPREFIX."fanfiction_inseries drop index sid;"); dbnumrows(dbquery("SHOW INDEX FROM ".TABLEPREFIX."fanfiction_inseries WHERE Key_name = 'PRIMARY'")); dbquery("alter table ".TABLEPREFIX."fanfiction_inseries drop primary key"); dbquery("alter ignore table ".TABLEPREFIX."fanfiction_inseries add primary key (sid,seriesid,subseriesid);"); SHOW INDEX FROM [tableprefix]_fanfiction_inseries WHERE Key_name = 'seriesid'; alter table [tableprefix]_fanfiction_inseries drop index seriesid; SHOW INDEX FROM [tableprefix]_fanfiction_inseries WHERE Key_name = 'inorder'; alter table [tableprefix]_fanfiction_inseries drop index inorder; alter table [tableprefix]_fanfiction_inseries add index (seriesid,inorder); SHOW INDEX FROM [tableprefix]_fanfiction_inseries WHERE Key_name = 'sid'; alter table [tableprefix]_fanfiction_inseries drop index sid; SHOW INDEX FROM [tableprefix]_fanfiction_inseries WHERE Key_name = 'PRIMARY'; alter table [tableprefix]_fanfiction_inseries drop primary key; alter ignore table [tableprefix]_fanfiction_inseries add primary key (sid,seriesid,subseriesid); SELECT * FROM [tableprefix]_fanfiction_inseries WHERE 'seriesid'; alter table [tableprefix]_fanfiction_inseries drop index seriesid; SELECT * FROM [tableprefix]_fanfiction_inseries WHERE 'sid'; alter table [tableprefix]_fanfiction_inseries drop index sid; SELECT * FROM [tableprefix]_fanfiction_inseries WHERE 'inorder'; alter table [tableprefix]_fanfiction_inseries drop index inorder; SELECT * FROM [tableprefix]_fanfiction_inseries WHERE 'subseriesid'; alter table [tableprefix]_fanfiction_inseries add index (seriesid,inorder); SELECT * FROM [tableprefix]_fanfiction_inseries WHERE 'confirmed'; SELECT * FROM [tableprefix]_fanfiction_inseries WHERE 'PRIMARY'; alter table [tableprefix]_fanfiction_inseries drop primary key; alter ignore table [tableprefix]_fanfiction_inseries add primary key (sid,seriesid,subseriesid); -*-*-*- Why it Fails Using MySQL 4.x and/or PHP 4 [2010/10/10] The 'SHOW INDEX FROM' command seems to fail in PHP4/MySQL4... as it may not be supported. -*-*-*- MySQL 4.x Fix for eFiction 3.5.3 [2010/10/10] *NOTE: You MUST backup your database first before doing this if you don't know what you are doing. I haven't, but things do break, after all.* Main Update Fix 1. Open eFiction 3.5.3's update.php in a text editor that counts lines. 1a. Windows: Notepad2, Notepad++. 1b. Linux: vi, emacs, gedit, kate, KWrite 2. From around line 305 to 317, erase the entire selection. Get rid of the bracket in Line 317 as well, otherwise it will break the PHP file. Save and update eFiction. 2a. Line 305: if($oldVersion[1] == 5 && $oldVersion[2] < 3) { 2b. Line 316: dbquery("alter ignore table ".TABLEPREFIX."fanfiction_inseries add primary key (sid,seriesid,subseriesid);"); 2c. Line 317: } 3. You now have to fix the primary key in your eFiction archive's database. Choose a method from below. phpMyAdmin Method 1. Go to your phpMyAdmin URL. Enter username and password. 2. Go to your eFiction database. My test one was testscript7. 3. Go to the 'inseries' table. Run these queries in the Query field: alter table [tableprefix]_fanfiction_inseries drop primary key; alter ignore table [tableprefix]_fanfiction_inseries add primary key (sid,seriesid,subseriesid); where [tableprefix] is the table prefix set for your archive, if necessary. Change that promptly. 4. If the Index of the database's table shows something other than seriesid and inorder, use the following queries: alter table [tableprefix]_fanfiction_inseries drop index seriesid; [*] alter table [tableprefix]_fanfiction_inseries drop index sid; [*] alter table [tableprefix]_fanfiction_inseries drop index inorder; [*] alter table [tableprefix]_fanfiction_inseries add index (seriesid,inorder); [**] where [tableprefix] is the table prefix set for your archive, if necessary. Change that promptly. [*] - Not usually necessary. [**] - Not usually necessary, but may have to execute if it is missing. You are now done. MySQL Command Line Method 1. Invoke MySQL. 1a. If using MySQL 4.x Install for Windows, type your password and hit Enter. 1b. If using MySQl no-Install for Windows, use the command below. 1c. If using Linux or MacOS (usually X), the login command is the same below. 1d. Command to Login is "mysql -u [username] -p", where [username] is, well, your username. Type password as prompted. 2. After a successful login, invoke the following commands in this order: 2a. SHOW DATABASES; - shows thr following databases you created. 2b. USE [database]; - Uses the database you specified. [database] is the name of the database you specified. 2c. SHOW TABLES; - Shows the tables within the specified database. 3. The tables list that the command in 2c invoked should show up. You need to modify the fanfiction_inseries table in that database. Use the following queries in this order: alter table [tableprefix]_fanfiction_inseries drop primary key; alter ignore table [tableprefix]_fanfiction_inseries add primary key (sid,seriesid,subseriesid); where [tableprefix] is the table prefix set for your archive, if necessary. Change that promptly. 4. If the Index of the database's table shows something other than seriesid and inorder, use the following queries: alter table [tableprefix]_fanfiction_inseries drop index seriesid; [*] alter table [tableprefix]_fanfiction_inseries drop index sid; [*] alter table [tableprefix]_fanfiction_inseries drop index inorder; [*] alter table [tableprefix]_fanfiction_inseries add index (seriesid,inorder); [**] where [tableprefix] is the table prefix set for your archive, if necessary. Change that promptly. [*] - Not usually necessary. [**] - Not usually necessary, but may have to execute if it is missing. You are now done. --CW Cyrix/Ami Sapphire, 2010/10/08-10