Re: [PHP] class and global

2005-03-21 Thread Mister Jack
Ok, i've found a workaround. So contrary to what is stated apparently in the documentation I had to declara the variables explicitely global to make it working and to create the object and assign _without_ reference. to sum up : global $freedb; $freedb = new freedbaxs(); function

Re: [PHP] class and global

2005-03-20 Thread Mister Jack
Ok, I've tried with a dummy class : class dummy { var $yank; Function dummy() { $this-yank = test dummy; } } and the problem is exactly the same. i've done print_r($dummy); is works ok outside the function, but inside print_r($dummy) doesn't

[PHP] class and global

2005-03-19 Thread pooly
Hi, I'm trying to use a global object (declared at a upper level), but all I got is : Call to a member function on a non-object in /home/pooly/public_html/templeet/modules/freedb.php on line 16 part of the code is : $freedb = new freedbaxs(); Function return_freedb_search($array) { global

Re: [PHP] class and global

2005-03-19 Thread Evert - Rooftop Solutions
pooly wrote: I'm trying to use a global object (declared at a upper level), but all I got is : Call to a member function on a non-object in /home/pooly/public_html/templeet/modules/freedb.php on line 16 part of the code is : $freedb = new freedbaxs(); Function return_freedb_search($array) {

Re: [PHP] class and global

2005-03-19 Thread Mister Jack
The initialisation seems to be ok, since : Function return_freedb_search($array) { global $freedb; $freedb = new freedbaxs(); [snip] $freedb-freedb_search($txt); //line 16... } works and also $freedb = new freedbaxs(); $freedb-freedb_search(ploplop); Function return_freedb_search($array) {

Re: [PHP] class and global

2005-03-19 Thread BAO RuiXian
Evert - Rooftop Solutions wrote: pooly wrote: I'm trying to use a global object (declared at a upper level), but all I got is : Call to a member function on a non-object in /home/pooly/public_html/templeet/modules/freedb.php on line 16 Hmm, perhaps your problem is the failed connection to your

Re: [PHP] class and global

2005-03-19 Thread Mister Jack
there is no database connection involved here. if I displace the $freedb = new freedbaxs(); inside the function it's works. I should give a try with a dummy object. (but the constructor, only initialize empty array) On Sat, 19 Mar 2005 21:17:02 +0200, BAO RuiXian [EMAIL PROTECTED] wrote:

[PHP] [Class] Behaviour global variables

2002-08-14 Thread Tim Stoop
Hi there, I'm forgetting something, but I can't seem to get to it... Consider the following Class. class Test { var $a; var $b; function Test() { $this-a = 2; $this-b = 5; } function Show() {

RE: [PHP] [Class] Behaviour global variables

2002-08-14 Thread Richard Black
] [Class] Behaviour global variables Hi there, I'm forgetting something, but I can't seem to get to it... Consider the following Class. class Test { var $a; var $b; function Test() { $this-a = 2; $this-b = 5

Re: [PHP] [Class] Behaviour global variables

2002-08-14 Thread Bas Jobsen
$TEST= new TEST; $a=3; $b=4; $TEST-Show(); works, fine better to use $GLOBALS['a'] instead of global $a Op woensdag 14 augustus 2002 15:27, schreef Tim Stoop: Hi there, I'm forgetting something, but I can't seem to get to it... Consider the following Class. class Test { var $a;