mysql_close() warning?

They have: 28 posts

Joined: May 2003

Hi, i've already had 2 php scripts give me a myql_close warning like the one below.

Quote: 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

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

Make sure you have an active mySQL link first.
If you are providing an argument to the function call, make sure it is an active database link (not a query, or result, or recordset).

Mark Hensler
If there is no answer on Google, then there is no question.

They have: 28 posts

Joined: May 2003

Yikes, it looks like it was trying to close the DB twice. I think i fixed it, thanks.

They have: 238 posts

Joined: May 2002

Warning: mysql_close(): 5 is not a valid MySQL-Link resource in /home/username/public_html/classes/database.php on line 132

Should the : be a semi colon?
mysql_close();

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

Well, in your code it should be. But in the warning, it may be a colon to seperate information in the error.

They have: 238 posts

Joined: May 2002

Oh ok..

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.