Quick Question ..
Throughout my site im going to need my database info ..
Now what i have done is setup a header (header.php) , that i simply required_once('constants.php'); and inside constants.php is my database info and some other constants that i use.
Now .. is it better to store my DB info like this
define("DB_SERVER", "localhost"); // Server
define("DB_USER", "xxxx"); // Username
define("DB_PASS", "xxxx"); // User pass
define("DB_NAME", "xxxx"); // Database
mysql_connect(DB_SERVER, DB_USER, DB_PASS) or die(mysql_error()); // Connection
mysql_select_db(DB_NAME) or die(mysql_error()); // Selection of database
Or would it be better to Assign the database info to varibles .. Or does it not matter?
Feedback please.