lout — 2007-01-04T12:51:18-05:00 — #1
I get an error message saying:
mysql_close(): no MySQL-Link resource supplied
But it doesn't happen every time the script executes. I can't figure out when it does happen. Can somebody tell me what's going on and how to fix it? Thanks.
jake_arkinstall — 2007-01-04T13:01:24-05:00 — #2
just don't include mysql_close();.
I never use it, i don't know anyone who does.
clamcrusher — 2007-01-04T18:20:41-05:00 — #3
see the documentation for info and an example of how to use a function.
youre getting that error because you didnt pass a link to the function. as the manual sais, if you dont pass a link, it uses the last opened connection. if you didnt open a connection, it tries to create one so it can close it(pointless).
solution? dont use the function unless you have a connection to be closed, or just dont even close it, php will do it for you.
read the manual.
cranial_bore — 2007-01-05T01:28:27-05:00 — #4
Only time to explicitly close the connection is if you have a script that will continue to execute for a long time after the DB connection is needed (e.g image processing, mailing, serving file download).
Otherwise the connection is closed anyway.