Hi,
Problem At Hand: Include my config.php file which contains the string variables I want to use inside my global.php file which contains a connect() method which I am trying to use.
What's Going Wrong: It successfully is including the config.php file but it doesn't seem to have access to the variables when inside the connect() method.
Question: How do I make the method have access to these variables?
Sample config.php Code:
<?php
$db = "db";
$name = "name";
$pass = "password";
$tbl = "table";
?>
Sample global.php Code:
function connect() {
$link = mysql_connect($db, $name, $pass);
$dbtable = mysql_select_db($tbl);
}
It breaks at the "$link" portion of code...which leads me to believe that the variables aren't being used correctly. I also tried a print statement directly above the $link and it wouldn't print anything out.
Any help would be greatly appreciated as I am trying to further understand PhP :)
Thanks!