Drezard Posted April 1, 2008 Share Posted April 1, 2008 Trying to use the Define() function with no output. Please help. Whats wrong with this code here: (Another script executes this class) database.php <?php include('extensions/includes/database.conf.php'); class database { // declare a variable for holding connection information private $database_connection; // connect to the database function __construct () { // takes all the variables and connects to the database server $this->database_connection = mysql_connect (DATABASE_SERVER, DATABASE_USERNAME, DATABASE_PASSWORD); // selects the database thats on the database server mysql_select_db (DATABASE_DATABASE, $this->database_connection); } } ?> extensions/includes/database.conf.php <?php define('DATABASE_USERNAME', 'username'); define('DATABASE_PASSWORD', 'password'); define('DATABASE_HOST', 'localhost'); define('DATABASE_DATABASE', 'press'); ?> Thanks, Daniel Quote Link to comment Share on other sites More sharing options...
trq Posted April 1, 2008 Share Posted April 1, 2008 Make sure you have error reporting on as I'm sure the issue is your file ins't being included properly. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.