* Dinçer akay <[EMAIL PROTECTED]>:
> Is this a good way ?
> <?
>
> class main{
>     var $mysql;
>     var $user;
>     function main(){
>         $this->mysql=new mysql();
>         $this->user=new user();

If you're developing strictly for PHP5, this will work fine. However, if
you're in PHP4, you're going to want to use references. Try the
following:

          $mysql       =& new mysql();
          $this->mysql =& $mysql;
          $user        =& new user();
          $this->user  =& $user;

Other than that, yes, this is a fairly standard mechanism in PHP's OOP.

-- 
Matthew Weier O'Phinney           | mailto:[EMAIL PROTECTED]
Webmaster and IT Specialist       | http://www.garden.org
National Gardening Association    | http://www.kidsgardening.com
802-863-5251 x156                 | http://nationalgardenmonth.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to