B
Bluewind
Guest
Problem has been SOLVED.
I have some classes, but I can't use the variables off one of them in the others.
The relevant code:
index.php
mysql_class.php
At the point of the var_dump() I don't have any variable called $sfs. Is
impossible or do I have to catch the main class ($sfs) in the construct (if yes, please say how)?
Thanks in advance.
I have some classes, but I can't use the variables off one of them in the others.
The relevant code:
index.php
PHP:
//--------------------------------
// INIT other classes
//--------------------------------
$sfs->mysql = new mysql_driver();
$sfs->mysql->sfs =& $sfs;
$sfs->mysql->connect();
mysql_class.php
PHP:
class mysql_driver {
function __construct(){
}
function connect(){
var_dump($sfs);
$this->connection_id = @mysql_connect($sfs->INFO['sql_host'], $sfs->INFO['sql_user'], $sfs->INFO['sql_pass']);
if (!$this->connection_id) {
$this->fatal_error();
}
if (!mysql_select_db($sfs->INFO['sql_database'], $this->connection_id)) {
$this->fatal_error();
}
}
}
PHP:
$sfs->mysql->sfs =& $sfs;
Thanks in advance.