Demonic Posted September 19, 2006 Share Posted September 19, 2006 is it this correct?[code]<?phpfunction connect($localhost,$username,$password,$database);mysql_connect('$localhost','$username','$password') or die(mysql_error));mysql_select_db('$database') or die(mysql_error());return $localhost,$username,$password,$database;}?>[/code] Quote Link to comment Share on other sites More sharing options...
Barand Posted September 19, 2006 Share Posted September 19, 2006 No.You can only return a single value, however that value can be an array. So you couldreturn array($localhost,$username,$password,$database);But in that case, having passed those values to the function and they remain unchanges in the function, where's the point in then returning them again? Quote Link to comment Share on other sites More sharing options...
Demonic Posted September 19, 2006 Author Share Posted September 19, 2006 so changing what i have to:return array($localhost,$username,$password,$database);would work? Quote Link to comment Share on other sites More sharing options...
Barand Posted September 19, 2006 Share Posted September 19, 2006 Pointless, but should work. 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.