The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Fatal error: Call to a member function query_first_slave() on a non-object
Hi all.
(Using version 3.8.1) I'm trying to write some code outside of VB. However, when i include the first VB file i get this fatal error: Code:
Fatal error: Call to a member function query_first_slave() on a non-object in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\mywebsite\forum\includes\functions.php on line 1368 Here's the code that's throwing the fatal error: Code:
class myclass { public function doSomething() { chdir('/path/to/forum'); require_once '/path/to/forum/global.php'; } } Thanks. |
#2
|
|||
|
|||
What is the first file you include? You must always include global.php before including any others.
|
#3
|
|||
|
|||
global.php is the only file I'm including! I'm also getting two warnings before the fatal error.
Code:
Warning: array_keys() [function.array-keys]: The first argument should be an array in [path]\includes\functions.php on line 4227 Warning: Invalid argument supplied for foreach() in [path]\includes\functions.php on line 4227 Fatal error: Call to a member function query_read_slave() on a non-object in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\mysite\forum\includes\functions.php on line 3189 |
#4
|
|||
|
|||
Actually looking at your code again your problem is that you are trying to use it inside a class function. This will not work.
|
#5
|
|||
|
|||
OK - code moved and now it works. Thanks for the help.
Thread resolved. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|