Deathwillow Posted December 11, 2010 Share Posted December 11, 2010 Ok this is weird.... something so simple has become a fairly large and annoying issue. So I started getting the error: Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in /hermes/web03/b36/pow/IM/roster2/test.php on line 6 I made a simple test page to see if it was anything in the scripts but nothing. the page I load is: <?php $connection = mysql_connect("","","") or die(mysql_error()); $connection = mysql_select_db("") or die(mysql_error()); echo $connection; mysql_close($connection); ?> The first echo returns 1 while the next line is the one above... how is something so easy and simple going so wrong? Quote Link to comment https://forums.phpfreaks.com/topic/221318-mysql-close/ Share on other sites More sharing options...
PFMaBiSmAd Posted December 11, 2010 Share Posted December 11, 2010 You are overwriting $connection by assigning it the true/false that mysql_select_db() returns. Only mysql_connect() returns a connection link. Quote Link to comment https://forums.phpfreaks.com/topic/221318-mysql-close/#findComment-1145758 Share on other sites More sharing options...
Deathwillow Posted December 11, 2010 Author Share Posted December 11, 2010 Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/221318-mysql-close/#findComment-1145787 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.