note 21877 deleted from language.oop by jmcastagnetto
| From: | jmcastagnetto@php.net | Date: | Fri, 04 Oct 2002 00:27:10 +0000 |
| Subject: | note 21877 deleted from language.oop by jmcastagnetto | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-37642@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?