I hava a class called DBhelper, and now I created a new class called UserManager. I need the UserManager have functions like GetUserId() and CheckValidation().So I require the DBhelper for those database actions. But I found it doesn't work like this:
require_once('DBhelper.php');
class User{
public $databaseHelper = new DBhelper();//syntax error
public $DB = $databaseHelper->connectDB();//syntax error
public function GetUserId(){
$this->databasesHelper->RunSql();//syntax error
...
}
public function CheckValidation(){
$this->databasesHelper->RunSql();//syntax error
...
}
}
Please halp me, I have searched the internet for long time. thanks.