Proper coding?
| From: | Jim MacDiarmid | Date: | Thu, 25 Mar 2004 04:33:56 +0000 |
| Subject: | Proper coding? | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-23267@lists.php.net to get a copy of this message | ||
Fellow PHP list members,
I'm hoping you can share your knowledge and help me. I'm incorping the
PEAR:DB module into my scripts and I'm running into a situation. To
make a long story short.. I basically have 2 files. Index.php and an
include file I'm calling db_functions.php which I'm creating myself. **
NOTE: watch for wrapping **
In the index.php file I have the following code:
require_once('include/db_connect.php');
require_once('include/db_functions.php');
/* includes commonly used functions */
require_once('common.php');
$sphist_rec_count =
GetRecCount('RecentActiveSpaces','RECENT_SPACE_COUNT');
In my db_functions.php, I have the function called GetRecCount(). It
basically retrieves the
Record count from a mySQL table. For some reason, the "db_object" object
doesn't get created unless
I include the db_connect.php inside the GetRecCount function. Something
tells me that this is not proper
Coding, and I was wondering if someone could tell me if there is another
way to do this?
Thanks,
Jim