what would cause this error, it seems that database can be connected but i cannot do it with the below code to this specific database on this server but i can connect to some other host database with below code, can you please help? Warning: mysql_query() [function.mysql-query]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
some part of first config file
<?php
/**
*
*/
$sys_lang = "tr";
$config = array();
//include("lang_en.php");
//Veritabani degiskenleri.
date_default_timezone_set("Europe/***");
$ini_kur = 1;
if (isset($_GET["lang"]))
{
//if ($_GET["lang"] == "tr" || $_GET["lang"] == "en")
if ($_GET["lang"] == "tr" || $_GET["lang"] == "en")
{
setcookie("lang", "");
setcookie("lang", $_GET["lang"], time()+1296000);
}
else
{
setcookie("lang", "");
setcookie("lang", "tr", time()+1296000);
}
header("Location: ".$_SERVER['PHP_SELF']);
die();
}
$sys_lang = (isset($_COOKIE["lang"])) ? $_COOKIE["lang"] : "tr";
$sys_lang = "tr";
if (!function_exists('secureVars')) {
function secureVars($string) {
$string = strip_tags($string);
$string = htmlspecialchars($string);
$string = trim($string);
$string = stripslashes($string);
//$string = mysql_real_escape_string($string);
return $string;
}
}
foreach ($_POST as $k=>$v) {
$_POST[$k] = secureVars($v);
}
foreach ($_GET as $k=>$v) {
$_GET[$k] = secureVars($v);
}
$dbH = "xxx.xx.x.xxx";
$dbU = "mydatabaseuser";
$dbP = "mypassword";
$dbD = "mydatabase";
//Session
$config["session_save_path"] = "";
//
//$config["pwd_date"] = "2010-04-12";
//
//
$config["log_dir"] = "-";
...............................................
second config file
<?php
ob_start();
/*
$dbH = "localhost";
$dbU = "root";
$dbP = "root";
$dbD = "live";
*/
$dbH = "xxx.xx.x.xxx";
$dbU = "mydatabaseuser";
$dbP = "mypassword";
$dbD = "mydatabse";
$site = array();
$site["email"] = "-.com";
$site["name"] = "-";
$site["title"] = "-";
$site["URL"] = "-.com"; //
$site["mailHost"] = "-";
$site["mailUser"] = "-";
$site["mailPass"] = "-";
?>