Hi all,
I've a problem with an external configuration file and a class that need to use some vars configured in this file.
this is the code:
<?php
require_once("../common/configuration/db_config.php");
class sql_functions
{
function get_connection()
{
//Globalize db configuration variables
global $_db_host, $_db_uname, $_db_pwd, $_db_name;
//Connect to database
$conn = mysql_connect($_db_host,$_db_uname,$_db_pwd);
mysql_selectdb($_db_name,$conn);
//Return connection
return $conn;
}
}
?>
I can't access to global variables $db* that are in db_config.php.
Is there anyone that can help me?