I'm having the worst time with this and I'm not sure what my deal is. I'm trying to call up a connection/query class into another class. The 'another' class is clearly working with the 'connquery' but it's throwing this error at me:
Fatal error: Call to undefined method Published::query() in /Library/Apache2/htdocs/sys/libs/class.mysql.php on line 63
The issue, I believe, is that the 'connquery' class is not passing the connection variables along to the new class - I'm not sure why. When I test the connquery class on it's own (outside the another class) it works just fine. So, missing vars...
'global' is not working here either to get them in the class.
What am I missing?
Some code...not sure if this even matters though:
include $_SERVER['DOCUMENT_ROOT'].'/config.php';
include $_SERVER['DOCUMENT_ROOT'].'/sys/libs/class.mysql.php';
$db = new DbClass;
$published = new Published; // the constructor should print_r something for me, it's not
$p = $db->fetchRecord("SELECT * FROM settings"); // this works great
print_r($p);
// the Published class - all we need to see that is
class Published
{
function Published()
{
global $some_settings; // but i shouldn't need this i believe
$p = DbClass::fetchRecord("SELECT * FROM settings");
print_r($p);
}
// etc...
}
// once again, the error message as above...