[PHP] Re: green bean question on singleton php5

2008-01-16 Thread julian
That very much make sense. I am indeed doing two assignments. I was just wondering how to call the constructor. The new statement was the only way I saw and it only worked in an assignment . I could not call dbaccess(); nor dbaccess::dbaccess();... Probably the easiest way is a mix

[PHP] Re: green bean question on singleton php5

2008-01-16 Thread Colin Guthrie
Julian wrote: > > but that forces me to implement a large interface of functions that I > prefer to avoid... > > the $dummy thing works... but I guess it is not "by the book". > > I would like to understand what am I missing fom the concept You made a critial error in the original implem.

[PHP] Re: green bean question on singleton php5

2008-01-16 Thread Colin Guthrie
julian wrote: > > > Hi, > > I am implementing this > > class dbaccess{ > static $db=null; > static $othervar=33; > > private function dbaccess(){ > dbaccess::$db= new mysqli("localhost",USER,PASSWD,DB); > if(mysqli_connect_errno()){ > echo "no way"; > } > } >