Hi I'm trying to use the functions/methods of one class inside another, however I keep getting errors and I don't understand this...
for example;
class DB {
private $host;
private $user;
private $pass;
private $database;
public function __construct($host, $user, $pass, $database) {
...
}
public function query($sql) {
...
}
}
$db = new DB;
class Permissions {
global $db;
public function update($user_id) {
$this->db->query("UPDATE `users` SET `user_name` = 'Dom'....");
}
}