【发布时间】:2011-04-06 22:18:40
【问题描述】:
所以我有这个类,其中包含一些名为 class.php 的自定义函数 我有另一个名为 config.php 的文件,其中包括
require('engine.class.php');
$engine = new engine;
config.php 还需要 functions.php 像这样运行:
require('functions.php');
我在functions.php中有一个使用$engine的函数,例如:
function login($username, $password){
return $engine->mysql_query('SELECT `user_id` WH...', 'array);//this is custom function in class.php
}
但是当我运行需要 config.php 的页面时,我收到一些错误,例如:
Fatal error: Call to a member function mysql_query() on a non-object in ../somedir/functions.php on line 3
【问题讨论】: