this file is called db.class.php
<?
include ("dbdetails.php");
class DATABASE {
function fetchArray($what) {
return mysql_fetch_array(mysql_query($what));
}
}
$DB = new DATABASE;
?>
This is another file, called test.php
<?
include ("db.class.php");
$q = "SELECT * FROM Users where ID='1'";
$str = $DB->fetchArray($q);
echo "$str[userName]";
?>
I keep getting this error:
Fatal error: Call to a member function fetchArray() on a non-object in C:\Program Files\XAMPP\xampp\htdocs\bbsart\sys\test.php on line 4
Anyone know what this means?