Fluf Posted September 25, 2008 Share Posted September 25, 2008 Do i miss something?? function mysql_conn($host,$username,$password,$db) { mysql_connect($host,$username,$password); mysql_select_db($db); } mysql_conn("localhost","user","password","dbname"); And when i try to use mysql_query then mysql_error() keeps telling me no database selected, i even made a whole new function for mysql_select_db, didn't work..i keep asking myself, why??? Quote Link to comment https://forums.phpfreaks.com/topic/125822-setting-mysql-connection-in-function/ Share on other sites More sharing options...
discomatt Posted September 25, 2008 Share Posted September 25, 2008 Is error_reporting on? Perhaps there was an error selecting the database. Quote Link to comment https://forums.phpfreaks.com/topic/125822-setting-mysql-connection-in-function/#findComment-650600 Share on other sites More sharing options...
Fluf Posted September 25, 2008 Author Share Posted September 25, 2008 Okey, i know now what's wrong..i saved this file in wrong place all the time and my script used the old file:D Quote Link to comment https://forums.phpfreaks.com/topic/125822-setting-mysql-connection-in-function/#findComment-650601 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.