i have class like this in my config.php file
class Config {
public static $__db = array(
"host" => 'l',
"username" => 'u',
"password" => 'p',
"database" => 'x'
);
}
and when i try to add this
$q = $db->query("SELECT * FROM x ORDER BY `id` ASC");
$ad = array();
while($row = $db->fetchAll($q))
{
$ad[] = $row;
}
i always get this error
Fatal error: Call to a member function query() on a non-object in /
how i ca solve this please ?
try include your config file where you call the function
or try this link http://www.php.net/manual/en/language.oop5.static.php