jarednz Posted December 23, 2006 Share Posted December 23, 2006 file = main_api.php[code] $database = "blah";[/code][code]function dbConnect() { global $database, $hostname, $username, $password, $db; $db = mysql_connect($hostname, $username, $password) or die ("Error connecting to database."); mysql_select_db($database, $db) or die ("Couldn't select the database."); return $db; }[/code]returns..[code]Undefined variable: database in d:\inetpub\www\core\main_api.php on line 48Couldn't select the database.[/code]what am I missing here? I've specified my global variables but it still complains? Quote Link to comment Share on other sites More sharing options...
trq Posted December 23, 2006 Share Posted December 23, 2006 Check your spelling. Quote Link to comment Share on other sites More sharing options...
jarednz Posted December 23, 2006 Author Share Posted December 23, 2006 bah sorted.Not a spelling problem though. ??? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.