View Single Post
Old 11-09-2007, 08:45 PM   #16 (permalink)
sketchMedia
The Prestige
Advanced Programmer Top Contributor Good Samaritan 
 
sketchMedia's Avatar
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
sketchMedia is on a distinguished road
Default

ah i think i get what ur saying (finally i didnt find a fish but managed to find a source of caffine)

yes you could include it like:
PHP Code:
include_once('database.php'); 
$db = new database(); 
or if your class name is exactly the same as its file name you could use the magic __autoload method:

PHP Code:
function __autoload($class)
{
    include_once(
$class '.php');

so it automaticly includes any file it needs.

i hope that helps :)
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)
sketchMedia is offline  
Reply With Quote