Re: [php-list] Call to a member function on a non-object

2005-09-13 Thread Bob Sawyer
--- James Keeline <[EMAIL PROTECTED]> wrote: > Finally, and this may be it, all variables in functions are local to > that function (except for superglobals--hence their name). Your $db > object reference is defined outside the function but is out of scope > inside the function until you do add

Re: [php-list] Call to a member function on a non-object

2005-09-13 Thread James Keeline
> > > I have the following function declared: > > Check to see that $db is set properly. > > It is -- if I pull the query out of the function and run it, it > displays the proper value of $cnt. > > -Bob That error relates to object-oriented programming. If $db no longer has the correct object r

Re: [php-list] Call to a member function on a non-object

2005-09-13 Thread Bob Sawyer
--- James Keeline <[EMAIL PROTECTED]> wrote: > > I have the following function declared: > Check to see that $db is set properly. It is -- if I pull the query out of the function and run it, it displays the proper value of $cnt. -Bob __ Do You

Re: [php-list] Call to a member function on a non-object

2005-09-13 Thread James Keeline
--- bobsawyerdotcom <[EMAIL PROTECTED]> wrote: > I have the following function declared: > > -- > function rescount($flag) { >$cnt = $db->get_var("select count(SR_ID) from STATION_RESOURCES > where SR_FLAG = '$flag'"); >if ($cnt > 0) { > $cntl = ' [' . $cnt . ']'

[php-list] Call to a member function on a non-object

2005-09-13 Thread bobsawyerdotcom
I have the following function declared: -- function rescount($flag) { $cnt = $db->get_var("select count(SR_ID) from STATION_RESOURCES where SR_FLAG = '$flag'"); if ($cnt > 0) { $cntl = ' [' . $cnt . ']'; echo $cntl; } } -- and am passin