Fatal error: Call t...
 
Notifications
Clear all

Fatal error: Call to undefined function dbquery() in upgrade20.php

32 Posts
4 Users
0 Reactions
18.6 K Views
(@marauder-by-midnight)
Posts: 56
Trusted Member
Topic starter
 

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?


 
Posted : 15/03/2008 8:38 pm
(@tammy)
Posts: 2577
Member Moderator
 

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.


 
Posted : 15/03/2008 9:45 pm
(@marauder-by-midnight)
Posts: 56
Trusted Member
Topic starter
 

I reuploaded everything. I'm still getting that error.


 
Posted : 15/03/2008 10:20 pm
 Elle
(@jenny)
Posts: 594
Honorable Member
 

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: dramione.org
site: accio.nu

Available for skin/mod commission! πŸ™‚

 
Posted : 16/03/2008 7:47 am
(@marauder-by-midnight)
Posts: 56
Trusted Member
Topic starter
 

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 :/


 
Posted : 16/03/2008 9:45 am
(@tammy)
Posts: 2577
Member Moderator
 

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.


 
Posted : 16/03/2008 10:14 am
(@marauder-by-midnight)
Posts: 56
Trusted Member
Topic starter
 

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?


 
Posted : 16/03/2008 10:16 am
 Elle
(@jenny)
Posts: 594
Honorable Member
 

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: dramione.org
site: accio.nu

Available for skin/mod commission! πŸ™‚

 
Posted : 16/03/2008 11:24 am
(@marauder-by-midnight)
Posts: 56
Trusted Member
Topic starter
 

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);
}


 
Posted : 16/03/2008 11:59 am
 Elle
(@jenny)
Posts: 594
Honorable Member
 

In your config.php is there an include to dbfunctions.php?


archive: dramione.org
site: accio.nu

Available for skin/mod commission! πŸ™‚

 
Posted : 16/03/2008 12:03 pm
(@marauder-by-midnight)
Posts: 56
Trusted Member
Topic starter
 

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?


 
Posted : 16/03/2008 12:16 pm
(@mickinell)
Posts: 62
Trusted Member
 

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

 
Posted : 16/03/2008 12:17 pm
 Elle
(@jenny)
Posts: 594
Honorable Member
 

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: dramione.org
site: accio.nu

Available for skin/mod commission! πŸ™‚

 
Posted : 16/03/2008 12:21 pm
(@marauder-by-midnight)
Posts: 56
Trusted Member
Topic starter
 

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.


 
Posted : 16/03/2008 12:27 pm
 Elle
(@jenny)
Posts: 594
Honorable Member
 

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: dramione.org
site: accio.nu

Available for skin/mod commission! πŸ™‚

 
Posted : 16/03/2008 12:28 pm
Page 1 / 3
Share: