note 29172 added to language.oop
| From: | alex at rack1 dot php dot net | Date: | Wed, 05 Feb 2003 05:13:36 +0000 |
| Subject: | note 29172 added to language.oop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-43439@lists.php.net to get a copy of this message | ||
Trying to work with a large object dynamically here I've run into the following problem:
class test {
var $a;
var $b;
function test() {
... getting data from sql ...
$a = mysql_fetch_array($result,MYSQL_ASSOC);
foreach($a as $k => $v) {
$this->{$k} = $v;
}
}
}
This does not work. Though I can reference already set values in the class by the same
$this->{$k} dynamic method, they do not seem to set.
--
http://www.php.net/manual/en/language.oop.php
http://master.php.net/manage/user-notes.php?action=edit+29172
http://master.php.net/manage/user-notes.php?action=delete+29172
http://master.php.net/manage/user-notes.php?action=reject+29172