DarkOMEN Posted April 27, 2006 Share Posted April 27, 2006 Hello everyone, sorry if this has been asked (I searched the forums for a good while), here goes:I have a tree of require()'s that looks like the following:index.phpsystem/base.phpsystem/class/fetchall.phpsystem/class/query.phpNow, in that list, the top file includes the file under it includes the file under it includes the file under it. This works fine. Now, in query.php I create a class called query. If I try to instantiate 'query' from base.php, I get the following error:[code]Fatal error: Cannot instantiate non-existent class: query in home/johnhorn/public_html/equilibrium/system/base.php on line 35[/code]After this didn't work, I tried the following:In base.php:[code]require($equilibrium_rootdir.'system/config.php');require($equilibrium_rootdir.'system/includes/vars.php');require($equilibrium_rootdir.'system/includes/constants.php');require($equilibrium_rootdir.'system/class/query.php');$query = new Query;[/code]Same error:[code]Fatal error: Cannot instantiate non-existent class: query in home/johnhorn/public_html/equilibrium/system/base.php on line 35[/code]Note that the class Query is defined in query.php. I know I'm doing something PHP doesn't allow, but I'm not sure what or how I can get around this.EDIT: I should note that all the files are being read from. I can echo data from any of them, which prints out in HTML in index.php. Quote Link to comment Share on other sites More sharing options...
DarkOMEN Posted April 30, 2006 Author Share Posted April 30, 2006 Just posting to mention I solved this on my own. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.