Nesting / Associating Multiple Classes

From: Date: Wed, 12 Sep 2001 20:52:19 +0000
Subject: Nesting / Associating Multiple Classes
Groups: php.general 
Request: Send a blank email to php-general+get-67082@lists.php.net to get a copy of this message
Ok, So I have one particular class, that should be usable by other classes in an application. For example: class db_class { var name var name_2 function() { } function_2() { } } The class above is a general database class that's functions are needed by the other API classes to grab/parse data from a database. class other_class { var othername var othername2 function sys_list($sys_id) { $db = new db_class("user","pass","database","hostname"); ... } } However, when attempting to run a script like this, PHP will output an error regarding nesting classes. What is the best method to allow for nesting or associating these two classes, so the second can refer to the first? -Roy Roy Wilson, Jr. Principal Web Engineer, MIS Ain Spiorad Networks http://www.ainspiorad.net

« previous php.general (#67082) next »