10-05-2008, 08:05 PM
|
#2 (permalink)
|
|
The Addict
Join Date: Jun 2008
Posts: 335
Thanks: 2
|
Let's say the name of your DB class is MySQLAccess
PHP Code:
<?php
class user { private $db; public function __construct(MySQLAccess $db) { $this->db = $db; } }
$db = new MySQLAccess($dbInfo); $user = new user($db);
?>
This way the user class will NEED the object MySQLAccess to start up or it'll give off a fatal error.
|
|
|
|