Thread: Installing..
View Single Post
Old 09-23-2007, 06:19 PM   #4 (permalink)
Karl
The Reckoner
Advanced Programmer Top Contributor 
 
Karl's Avatar
 
Join Date: Sep 2007
Posts: 437
Thanks: 22
Karl is on a distinguished road
Default

The problem, as you correctly stated, is this line:

PHP Code:
$test = new    database($host$user$pass$data);
            if(!
$test) { 
I can see that you're testing to see if the database connection was successfull, but what you're actually testing is if the database object exists. The easiest solution (without changing alot of code) would be to simply remove the $this->connect() call from your class' __construct() method and call it after instantiating your class object, changing the current code to:

PHP Code:
$test = new    database($host$user$pass$data);
            if(!
$test->connect()) { 
You will also need to change the scope of the connect() function from private to public.
Karl is offline  
Reply With Quote