I have $mo_conf variable in a script named config.php and I want to acess it from another script mo_model.php. Both are in different directories.
The code:
config.php
$mo_conf['user'] = "root";
$mo_conf['password'] = "passwd";
$mo_conf['host'] = "localhost";
$mo_conf['database'] = "itienda";
mo_model.php
class MO_Model extends MO_Object
{
private $con;
static function db_connect()
{
$con = mysqli_connect($mo_conf['host'],$mo_conf['usr'],$mo_conf['password'],$mo_conf['database']);
}
}
After running the script the following notice is displayed:
Notice: Undefined variable: $mo_conf in C:\m\core\mo_model.php on line 59
What's wrong?
Thanks.