section31 Posted June 4, 2003 Posted June 4, 2003 Hi, i've already had 2 php scripts give me a myql_close warning like the one below. >Warning: mysql_close(): 5 is not a valid MySQL-Link resource in /home/username/public_html/classes/database.php on line 132 Does anyone know what normally causes this problem? thanks, section31 Quote
TCH-Rob Posted June 4, 2003 Posted June 4, 2003 Without seeing the code it is hard to say. If your code looks like this; $db = mysql_connect("server","user","pw") || die("error"); It should look like; $db = mysql_connect("server","user","pw"); if (! $db) { die("error"); } or if(!($db = mysql_connect("server","user","pw"))) { die("error"); } Is your script trying to open 2 db connections? Can we see some of the code? Quote
section31 Posted June 4, 2003 Author Posted June 4, 2003 Yikes, it looks like it was trying to close the DB twice. I think i fixed it, thanks. Quote
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.