Ok,
I must be going crazy.
I have a database connection class that I use to connect to databases.
This class is located in a directory called "includes" and is in a file called "classes.php".
This is the problem -
My script keeps saying "class DBconnect not found".
Well I went into the classes.php file and put a line of code in there that prints "Class file included". This way I KNOW the file is actually included. When I navigate to the page that includes the classes.php class AND try to declare a new object using the DBconnect class, I get the "Class file included" line - so I KNOW the class file is actually included.
So this is my question -
What else do I need to do to get this class to work?
Here is the class itself -
PRINT("Classes Included");
/* **** Database Connection Class **** */
class DBconnect
{
var $host = "localhost";
var $user = "uname";
var $pass = "pass";
var $database = "";
var $link = "";
function __construct($dbname)
{
$this->database = $dbname;
$this->link = mysql_connect($this->host,$this->user,$this->pass);
mysql_select_db($this->database,$this->link);
return $this->link;
}//end Constructor
}//end databaseConnection Class
And here is how I instantiate it -
<?php
session_start();
$org = $_SESSION['org'];
INCLUDE("http://site.com/cpanel/header.htm");
INCLUDE("http://site.com/cpanel/includes/classes.php");
//connect to database
$dbo = new DBconnect("$org");
?>
<h2>DONE</h2>
<?php
INCLUDE("http://site.com/cpanel/footer.htm");
?>
Can anyone see what I am doing wrong?