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? 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. 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. Link to comment https://forums.phpfreaks.com/topic/221318-mysql-close/#findComment-1145787 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.