Re: function reverse to get_object_vars
| From: | Richard Lynch | Date: | Tue, 15 Mar 2005 16:30:58 +0000 |
| Subject: | Re: function reverse to get_object_vars | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-210825@lists.php.net to get a copy of this message | ||
> Hello
>
> Do you know how to implement function reverse to get_object_vars?
> For example if I have class and I wish to set it's properties from
> database with loop through the columns in table?
If you are willing to have the object properties be the same names as the
columns, you do an assignment:
$object->$column = $value;
See http://mysql_field_name and friends.
--
Like Music?
http://l-i-e.com/artists.htm