Hello :)
class MyClass {
var $ID;
var $NAME;
var $SIZE;
}
$blabla = new MyClass();
Then i have in a mysqldb a table with following fields
ID, NAME, SIZE
So :) Now i get a row from the table and fetch it using
mysql_fetch_object.
$result = mysql_query("SELECT * FROM sometable LIMIT 0,1");
$row = mysql_fetch_object($result);
As You can see :) $row has the same properties as $blabla.
My question: is there a way to 'convert' the object
$row to te class MyClass without doin' it like this
$blabla->ID = $row->ID;
$blabla->NAME = $row->NAME;
$blabla->SIZE = $row->SIZE;
I would like simply to assign the values of the properties of $row
to $blabla.
thanks for any help :)
websafe
--
http://www.partybitchez.org/