Hi there,
This might a newbie question but I need help understanding PHP classes which am currently learning.
I have an index page.
With this three included files.
database.php
config.php
account.php
on database.php, the class is declared using $connection new Database(...), on this page is also all the coding for this class.
In config.php is a declared class of $account new Account($user_id);
and on account.php is all the details for the account class.
on the index.php is echo $account->sayHello;
However, My page is throwing out an error because I'm trying to use $connection->query(..) in my account.php / Account class.
I have tried to extend the Account class with Database but still have no luck.
How can I make sure the I can use a class function from another page in my Account class?
Thanks for reading