RE: [PHP-GTK] "Call to a member function on a non-object in C:\......."

From: Date: Fri, 21 May 2004 15:44:32 +0000
Subject: RE: [PHP-GTK] "Call to a member function on a non-object in C:\......."
Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-4539@lists.php.net to get a copy of this message
Perhaps best to post the offending code. Don't know about making a variable's scope permanently global. Probably wouldn't be good for data integrity, though. Anyone else have an idea about this? dave _______________________________________________________________________________________________________ Yes I tried using globals but I get the same error function delete_message() { $row = $GLOBALS['clist']->selection[0]; $get_msg_id = $GLOBALS['clist']->get_text($row, 0); echo $get_msg_id; } A note aside, I find it irritating having to declare globals in functions, no way to set it to global on declaration? -----Original Message----- From: dpgirago@mdanderson.org [mailto:dpgirago@mdanderson.org] Sent: 21 May 2004 16:19 To: php-gtk-general@lists.php.net Subject: Re: [PHP-GTK] "Call to a member function on a non-object in C:\......." Rhys, To use my previous example within a function, you need to access the object through the GLOBALS array... $row = $GLOBALS['cListPatientID']->selection[0]; $selectedPID = $GLOBALS['cListPatientID']->get_text($row,0); > "Call to a member function on a non-object in C:\......."

« previous php.gtk.general (#4539) next »