note 21877 added to language.oop

From: Date: Thu, 30 May 2002 10:25:24 +0000
Subject: note 21877 added to language.oop
Groups: php.notes 
Request: Send a blank email to php-notes+get-31185@lists.php.net to get a copy of this message
Hello. I have defined a class for querying a database called "db_query". When you instantiate the class using $myQuery = new db_query ($sql, $datasource); The results of the query are available from $myQuery->column[$row] now my point is; By the strict definition of a class declaration, you have to declare ALL the properties outside the methods. However, in this instance, it's impossible to declare the properties of the column headings before you've executed the query in the method. I expect it's VERY illegal to declare properties from within the method itself, so, is there a way around this, or is it okay to do it this way? -- http://www.php.net/manual/en/language.oop.php http://master.php.net/manage/user-notes.php?action=edit+21877 http://master.php.net/manage/user-notes.php?action=delete+21877 http://master.php.net/manage/user-notes.php?action=reject+21877

« previous php.notes (#31185) next »