--- 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 . ']';
>       echo $cntl;
>    }
> }
> ----------------------
> 
> and am passing it the following variable:
> 
> <?php rescount('b'); ?>
> 
> and am getting the following error msg:
> 
> 
> ----------------------
> Fatal error: Call to a member function on a non-object in
> /path/to/script.php on line 8
> ----------------------
> 
> I've tried rewriting this several different ways, all to no avail.
> What's giving me that error?
> 
> Thanks,
> -Bob


Check to see that $db is set properly.

James
_____


James D. Keeline
http://www.Keeline.com  http://www.Keeline.com/articles
http://Stratemeyer.org  http://www.Keeline.com/TSCollection

http://www.ITeachPHP.com -- Free Computer Classes: Linux, PHP, etc.
Fall Semester Begins Sep 7 -- New Classes Start Every Few Weeks.


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/HKFolB/TM
--------------------------------------------------------------------~-> 

Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to