Troubles with Classes

From: Date: Tue, 13 Aug 2002 21:21:42 +0000
Subject: Troubles with Classes
Groups: php.general 
Request: Send a blank email to php-general+get-112435@lists.php.net to get a copy of this message
Hey guys, I have a little problem here, I have one class to create queries to a mysql database, this class works fine, but, now I want to create an instance of this class inside another class but I'm receiving the error: Parse error: parse error, unexpected T_VARIABLE, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in D:\InetPub\hispanicroot\includes\database.php on line 134 This is my code: class SubMenu {
        var $attrib = array("level"=>"", "page"=>"", "section"=>"");
        $DBQuery = new DBQueries;       <--------------------------- this is line 134
                $DBQuery->attrib["type"] = "select";
                $DBQuery->attrib["query"] = "SELECT ID_Secpage, PageType, Title, PageURL FROM inf_secpages WHERE ID_Page = " . $attrib['page'] . " ORDER BY Slot ASC";
                $GetData = $DBQuery->RunQuery();
                bla bla bla ..........
} If I use:
        var $DBQuery = new DBQueries;
then I receive the error:
        Parse error: parse error, unexpected T_NEW in D:\InetPub\hispanicroot\includes\database.php on line 134
Thanks Jadiel Flores ------------------------- http://www.abargon.com jflores@abargon.com (52-55) 52-29-80-34

« previous php.general (#112435) next »