[ciapug] DB Manager Configuration file best practice?

Wade Arnold wade at t8design.com
Thu Mar 23 12:30:04 CST 2006


I am wondering if anyone has a best practice for setting up a configuration
file for my database connection variables

In the past I have used the code below but now that I am using classes it
fails to declare the constant. Any ideas or tidbits of wisdom?

Thanks;
Wade Arnold

<?php
// this will be in your DBManager.php
require_once dirname(__FILE__).'./conf/_dbconfig.inc';

echo DB_USER;
echo DB_PASSWORD;
echo DB_PASSWORD;
echo DB_HOST;
?>


<?php
// name this file _dbconfig.inc

/**
 * Thide defines CONSTANTS
 */
define( 'DB_USER', 'wadearno_bvlt1' );      // your MySQL username
define( 'DB_PASSWORD', 'zorwvMw5OV2L' );  // ...and password
define( 'DB_PASSWORD', 'wadearno_bvlt1' );   // the name of the database
define( 'DB_HOST', 'localhost' );     // mySQL Server (typically
'localhost')
?>



More information about the ciapug mailing list