note 37491 rejected from function.extract by didou
| From: | didou@php.net | Date: | Mon, 17 Nov 2003 20:13:23 +0000 |
| Subject: | note 37491 rejected from function.extract by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-60501@lists.php.net to get a copy of this message | ||
Note Submitter: php@exeunt.net
----
Is there any way to use this function to extract variables into an object?
Ie..
class A {
var $a;
var $b;
function A($id) {
$r = mysql_query("SELECT a,b FROM TABLE WHERE id='$id'");
$s = mysql_fetch_assoc($r);
extract($s, PREFIX_ALL, '$this->');
}
}
I know this code probably won't work, but any suggestions on working around this normally time
wasting activity would be great! Thanks