10-04-2009, 08:51 PM
(This post was last modified: 10-12-2009, 10:21 AM by MyNameIs940.)
Make a settings.inc.php and put this in there:
(CHMOD should be: 755)
then make database.php
(CHMOD should be: 644)
Then in all your codes put:
You are done
Note: If you need help with CHMOD visit this link: http://www.supportforums.net/showthread.php?tid=182
(CHMOD should be: 755)
PHP Code:
<?
$CONFIG['DBHOST'] = "localhost"; // Database servers location, normally localhost
$CONFIG['DBUSER'] = "username"; // sql user
$CONFIG['DBPASS'] = "password"; // db users password
$CONFIG['DBNAME'] = "database"; // Database to connect to
?>
then make database.php
(CHMOD should be: 644)
PHP Code:
<?
include("settings.inc.php");
$connection = mysql_connect($CONFIG['DBHOST'],
$CONFIG['DBUSER'],
$CONFIG['DBPASS']) or die("Could not establish a connection with mysql.");
mysql_select_db($CONFIG['DBNAME']) or die("Unable to select database.");
?>
Then in all your codes put:
PHP Code:
<? include("database.php"); ?>
You are done
Note: If you need help with CHMOD visit this link: http://www.supportforums.net/showthread.php?tid=182