[PHP] Access parent property from child

2007-08-09 Thread Suprie
dear all ... i have question, i've tried look at google but still can't figured out how to do it... i want access parent property from child object the code was like ? class DAO { private $db; private $id; protected function getId() { return $this-id; }

Re: [PHP] Access parent property from child

2007-08-09 Thread Stut
Suprie wrote: function getDB() { return $this-$db; } There should not be a $ before db. It should be $this-db. That's why PHP is telling you the property is empty... because it is. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To

RE: [PHP] Access parent property from child

2007-08-09 Thread Edward Kay
-Original Message- From: Suprie [mailto:[EMAIL PROTECTED] Sent: 09 August 2007 11:13 To: php-general@lists.php.net Subject: [PHP] Access parent property from child dear all ... i have question, i've tried look at google but still can't figured out how to do it... i want

Re: [PHP] Access parent property from child

2007-08-09 Thread Suprie
ouch... hey it's work rite now... thanks a lot for your help Edward and Stut, i really apprieciate it... br/// On 8/9/07, Stut [EMAIL PROTECTED] wrote: Suprie wrote: function getDB() { return $this-$db; } There should not be a $ before db. It should be $this-db.