so I have a php file called db.php which will be called in the web page :
<?php
define("EZSQL_DB_USER", 'xxxxx_xxxx');
define("EZSQL_DB_PASSWORD", 'xxxxxxx');
define("EZSQL_DB_NAME", 'xxxx_xxxx');
define("EZSQL_DB_HOST", 'localhost');
if (!function_exists('gettext')) {
function _($s) {return $s;}
}
?>
but on my website I want to check if the db is up and running:
<?php
$mysqlConnection = mysql_connect($server, $username, $password);
if (!$mysqlConnection)
{
echo "Please try later.";
}
else
{
mysql_select_db($database, $mysqlConnection);
}
?>
I dont know were to place the variables and what variables to change….
thanks
I think you’re looking for the following:
The variables in the connection string have been replaced with the constants you define using the define function.