Mysql_close() Error?

liunx

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