View Single Post
Old 04-26-2008, 11:00 AM   #2 (permalink)
freenity
The Acquainted
 
freenity's Avatar
 
Join Date: Feb 2008
Posts: 119
Thanks: 17
freenity is on a distinguished road
Default

you should have a property in your security class that would be an instance of database class:

PHP Code:
class Security
{
    private 
$db;

    public function 
__construct()
    {
        
$this->db = new Database();
    }

    public function 
blabla
    
{
        
$this->db->query()....
    }

Also it would be better to have a method like getDb() that will return the database object in stead of accessing to the variable directly.
__________________
http://feudal-times.net - My PBB Game
http://gwphp.feudal-times.net - My Blog "Gaming With PHP"
freenity is offline  
Reply With Quote