RE: [PHP-GTK] "Call to a member function on a non-object in C:\......."
| From: | Rhys Campbell | Date: | Fri, 21 May 2004 15:28:41 +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-4538@lists.php.net to get a copy of this message | ||
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:\......."
HTH,
dave