> > > 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 reference, you won't be able to access its methods. This can happen if you try to use a variable named $db after instantiating the object with the new keyword. Another possibility is that the method does not exist in the class definition or perhaps the spelling or capitalization of $db is not consistent. 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: global $db; to the top of your function definition. 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 --------------------~--> Most low income households are not online. Help bridge the digital divide today! http://us.click.yahoo.com/cd_AJB/QnQLAA/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/
