Here’s the problem, I have a database object I wrote. I want to use methods from that object in other classes, however, whenever I do, I get “Call to undefined method stdClass::runSQL()”
here is a simplified version of what is happening
class db {
public function runSQL() {
execute mysql query
}
}
$db = new $db();
class form {
public function doSomething() {
$query = “THIS IS A QUERY”;
$db->runSQL( $query );
}
}
$form = new $form();
$form->doSomething();
It doesn’t seem to like that at all, what’s the deal??? This has been driving me nuts for about a day now and I can’t take it any longer, I was hoping somebody on here might have some insight. Any help would be greatly appreciated!