Thanks for the reply!! But, did you noticed how mysql_fetch_object returns an object with some properties (variables) which is named after the fields that were selected.
example
I have an SQL STATEMENT
$sql =" SELECT username,password from users";
$qlink = mysql_query($db,$sql);
$row = mysql_fetch_object($qlink);
then now i can call,
echo "$row->username
$row->password
";
You see the object property named username and password was derived based on the selected fields.? If I again do an sql query.
$sql =" SELECT country,city from profile";
$qlink = mysql_query($db,$sql);
$row = mysql_fetch_object($qlink);
then now i can call,
echo "$row->country
$row->profile
";
In your example, the property b was already defined in class a(). Thats how you made the function make_a() returned an object .... but its object property was already defined. Its very different from what mysql_fetch_object does.. to me this is very insteresting... its like your enabling property insertion in runtime. 🙂
Jun