Hello! 🙂
I do have this, which works fine.
<?
$dbh=mysql_connect ("localhost", "ghost_user", "password") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("ghost_busdir");
$Query = "INSERT INTO categories(category) values('$category')" or die (mysql_error());
mysql_db_query ("ghost_busdir", $Query, $dbh) or die (mysql_error());
mysql_close($dbh);
?>
Depending on which domain I have the script, the database connection is different.
Is there any clever way to make include files or other way with the username (ghost_user), password and the lines:
mysql_select_db ("ghost_busdir");
and:
mysql_db_query ("ghost_busdir", $Query, $dbh) or die (mysql_error());
So that need only to be changed in some kind of settings file at one place and not all over the script files?
Huge thanks in advance.