Re: non-object problem.
| From: | Rich Payne | Date: | Wed, 01 May 2002 20:25:54 +0000 |
| Subject: | Re: non-object problem. | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-1894@lists.php.net to get a copy of this message | ||
On 1 May 2002, Miles Phillips wrote:
> Pasted below is a code example I am using. The edit function queries a
> database and pulls up information and populates gtkEntry boxes. When
> the update button is clicked, it is supposed to pass those entry box
> values to the update function. However, I get the call to a member
> function on a non-object fatal error. I am obviously missing something
> in my code, because the values are not getting passed. If anyone would
> like to point out my probably obvious mistake, it would be greatly
> appreciated.
I assume it's this line you're seeing the failure on?
$updFn=$entFName->get_text();
are $entFName (and company) defined outside of these functions? You see
you're creating these GtkEntries in the edit function, just saying
global in another function isn't enough. You need something like:
<?php
var $endFName;
......
function edit() {
global $entFName;
.....
}
function update () {
global $entFName;
....
}
?>
Does that help?
Also, you are calling update with a parameter ($Id), but have no variable
assigned to received that in the update function.
--rdp
--
Rich Payne
http://talisman.mv.com