The global variable is a class (object) already defined earlier
class Users
{
private $sql;
public function __construct() {
global $sql;
$this->$sql = $sql;
}
}
I'm trying to assign the object to a private variable in my other class (Users) so I don't have to use this line global $sql;
through all the functions in Users
but it's giving me this error:
Catchable fatal error: Object of class Bdcon could not be converted to string in /home/<<NAME>>/public_html/<<NAME>>/classes/class.users.php on line 8