Jump to content

Recommended Posts

Posted

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

Posted

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?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...