Hey guys,
I've written a function called add_category. It works off the code from categories from php. I'm having a devil of a time with scope though. When I run the code inline, it runs fine. However, when I throw function add_category( ) { } around the code, it throws:
Fatal error: Call to a member function Execute() on a non-object in /Applications/MAMP/htdocs/shop/admin/cat.php on line 105
I know this is a weird global scope issue or something. At the top of my file I have...
<?php
require_once('includes/application_top.php');
global $db;
Anyhow, What is the secret here? How do I work around this quirk. I'll be gosh durned and dipped in cherries before I use a goto.
Thanks,
Josh


Reply With Quote

