Jump to content

[PHP5] Define statement


Drezard

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/99049-php5-define-statement/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.