|
Connection failed
I am not familiar with php coding. I have a site which is already uploaded to server, now i want to run the script in local, but i am failed. From my view i have to change the connection file which is named db.inc and another is db_config.php. Please tell me where to change: The code is given below
1. db.inc:
<?
$hostName = "localhost";
$userName = "-------";
$passWord = "-------";
$dbName = "--------";
if (!($connection = @mysql_pconnect($hostName, $userName, $passWord)))
echo "no connection stablished!";
if (!@mysql_select_db($dbName, $connection))
echo "no database connectivity!";
// for web server
$siteAdmin = "http://www.-----.com/subfolder";
$siteUrl = "http://www.------.com";
2.db_config:
<?php
if (!defined("DB_SERVER")) define("DB_SERVER", "localhost");
if (!defined("DB_NAME")) define("DB_NAME", "---------");
if (!defined("DB_USER")) define ("DB_USER", "---------");
if (!defined("DB_PASSWORD")) define ("-------", "------");
|