First time extending a class in PHP and I'm getting a fatal error that says the method is private when it's not. I'm sure it's something elementary, but I've studied books and forums, and I just can't pin down what I've done to generate this error. Any help greatly appreciated. Details below:
Error message:
Fatal error: Call to private method testgiver::dbConnect() from context 'testprinter' in /root/includes/classes/testprinter.php on line 726
Line 726 of testprinter in the code below:
private function buildquestionarray()
{
$query = "etc etc";
**$conn = $this->dbConnect('read');
$result = $conn->query($query);
...
Testprinter extends testgiver. Here's the extension of the class:
require_once('testgiver.php');
class testprinter extends testgiver
{...
And the declaration of the method in testgiver:
protected function dbConnect($userconnecttype)
{...
Thanks again!