URL to your eFiction: http://fanfiction.mugglenet.com
Version of eFiction: 2.0.4
Have you bridged eFiction, if so with what?: n/a
Version of PHP: ---
Version of MySQL: ---
Have you searched for your problem: yes
If so, what terms did you try: error upgrade20.php
State the nature of your problem:
At first we had members playing with our eFiction settings because index.php linked directly to /install/install.php. Before and after I fixed that, I kept getting this error routinely during the upgrade process, making us start all over:
Fatal error: Call to undefined function dbquery() in /home/fanfiction/public_html/install/upgrade20.php on line 165
Line 165 of upgrade20.php is:
if(isset($_GET['step']) && $_GET['step'] > 2) {
$settings = dbquery("SELECT tableprefix, language FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '".$sitekey."'");
I'm able to get through the settings tables without getting this error, but when I get to step 6 or so, this error message becomes more frequent.
I'm also getting this error message at step 9:
A fatal MySQL error has appeared.
Query: INSERT INTO fanfiction_classtypes (`classtype_name`, `classtype_title`) VALUES('genres', 'Genres');
Error: (1062) Duplicate entry 'genres' for key 2
I know that to fix that error I'll have to delete a duplicate in my database, but how do I do that in a database bigger than 7000 stories?
Sorry, no. It's not people messing with your settings causing the problem though. Looks like you're missing some files. It can't find the database functions. Re-upload your includes folder.
I reuploaded everything. I'm still getting that error.
I didn't upgrade, so I'm not entirely sure on the solution, but dbquery() is:
function dbquery($query) {
global $debug, $headerSent, $dbconnect;
if($debug && $headerSent) echo "<!-- $query -->n";
$result = mysqli_query($dbconnect, $query) or die( _FATALERROR."Query: ".$query."<br />Error: (".mysqli_errno( $dbconnect ).") ".mysqli_error( $dbconnect ));
return $result;
}
archive:
site:
Available for skin/mod commission! π
I didn't upgrade, so I'm not entirely sure on the solution, but dbquery() is:
function dbquery($query) {
global $debug, $headerSent, $dbconnect;
if($debug && $headerSent) echo "<!-- $query -->n";
$result = mysqli_query($dbconnect, $query) or die( _FATALERROR."Query: ".$query."<br />Error: (".mysqli_errno( $dbconnect ).") ".mysqli_error( $dbconnect ));
return $result;
}
So I have to put that somewhere? Not sure what you're suggesting :/
That wiouldn't work. You need the dbfunctions.php file to be included as there are other functions that the script needs in that file as well.
If this is the dbfunction:
<?php
if(function_exists("mysqli_connect")) include_once(_BASEDIR."includes/mysqli_functions.php");
else if(function_exists("mysql_connect")) include_once(_BASEDIR."includes/mysql_functions.php");
else {
include(_BASEDIR."languages/en.php"); // Because we haven't selected a language setting yet
die(_FATALERROR._NODBFUNCTIONALITY);
}
?>
I do have it uploaded.
The error has popped up so many times I can't get past step 7 anymore.
Could there be a file I have that is conflicting with upgrade20.php?
I downloaded a new install of the latest eFic and looked in the file...
Before dbquery():
There's:
include ("../includes/class.TemplatePower.inc.php");
include("../config.php");
... which would mean that it's including config.php, which would have to have the include to the dbfunctions.php π Is that right in yours?
archive:
site:
Available for skin/mod commission! π
I downloaded a new install of the latest eFic and looked in the file...
Before dbquery():
There's:
include ("../includes/class.TemplatePower.inc.php");
include("../config.php");... which would mean that it's including config.php, which would have to have the include to the dbfunctions.php π Is that right in yours?
Yes this is the segment of upgrade20.php. Line 165 is bolded.
define("_BASEDIR", "../");
include ("../includes/class.TemplatePower.inc.php");
include("../config.php");
if(isset($_GET['step']) && $_GET['step'] > 2) {
$settings = dbquery("SELECT tableprefix, language FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '".$sitekey."'");
list($tableprefix, $language) = dbrow($settings);
define("TABLEPREFIX", $tableprefix);
define("SITEKEY", $sitekey);
}
In your config.php is there an include to dbfunctions.php?
archive:
site:
Available for skin/mod commission! π
Oh, there isn't. The only thing in my config.php are the settings in my eFic 2.x system.
How do I put it in?
How is your install 3.3.2? I thought the dowload was 3.3.1.
I can see your install from your site, btw...
URL to your eFiction: http://www.mickiclark.com/efiction33
Version of eFiction: 3.3.1
Have you bridged eFiction, if so with what?: SMF
Version of PHP:
Version of MySQL: MySQL 4.1.14
I was wondering about the 3.3.2, too. π
I think that's the error...but there will probably be a gazillion other errors after this one, or something'll break, lol; ever the optimist.
OK:
In mine, after the variables (last one is $settingprefix) I have:
include_once("includes/dbfunctions.php");
if(!empty($sitekey)) $dbconnect = dbconnect($dbhost, $dbuser,$dbpass, $dbname);
That should conclude the config.php
By the way, did you fix the genres error?
archive:
site:
Available for skin/mod commission! π
Where do I put that code, Jenny? In the upgrade20.php file probably, but after what code exactly?
Sorry you'll have to be really specific with me since I'm very new at this.
And I kind of fixed it - I just delete genres from the fanfiction_classtypes table and let step 9 recreate it.
That's OK. After the variables and before the ?>
I blanked out what mine are, but mine looks like this:
<?php
$dbhost = "";
$dbname = "";
$dbuser= "";
$dbpass = "";
$sitekey = "";
$settingsprefix = "";
include_once("includes/dbfunctions.php");
if(!empty($sitekey)) $dbconnect = dbconnect($dbhost, $dbuser,$dbpass, $dbname);
?>
archive:
site:
Available for skin/mod commission! π
