Hello all. I have a script that has settings for DB Username, DB Password, DB Name, and Table Name. I noticed that on some of my programs, they also ask for DB Host. This one does not. My website is hosted. Is there a way to add this functionality, or am I missing something in the code? I saw the following code in one of the files, and was wondering if I could just change it here where it says localhost, even though it is not in the config file? When I did try, nothing was posted to the table.
Thanks in advance...
Code:
#########################################################################
# DATABASE FUNCTIONS #
#########################################################################
if ($Action == "D" or $Action == "ED" or $Action == "CD" or $Action == "DF"){
$Connect = @mysql_connect("[b]localhost[/b]", "$SQL_UserName", "$SQL_Password");
@mysql_select_db("$SQL_Database",$Connect);
while (list ($key, $val) = each ($_SQL))
{
if ($key != "Settings" and $key != "Refresh")
{
$val = stripslashes($val);
$val = str_replace('"','"',$val);
$val = strip_tags($val);
$Columns .= $key . ',';
$Values .= "'" . $val . "',";
}
}
if ($SQL_ENV == "1")
{
$Columns .= "Received,IPAddress,Browser";
$Values .= "'" . $Time . "','" . $IPAddress ."','" . $Browser . "'";
}
else
{
$Columns = substr($Columns,0,-1);
$Values = substr($Values,0,-1);
}
@mysql_query("INSERT INTO $SQL_Table ($Columns) VALUES ($Values)");
@mysql_close($Connect);
} // END OF ACTION
Thanks in advance...