--- 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
> > > 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
--- 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
--- 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 . ']'
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