Jump to content

mysql_close


j05hr

Recommended Posts

Hi got a quick question about mysql_close.

 

I'm currently learning PHP from someone with an ASP background. And we were processing a form to another page.  (both these pages had a connection to a database.)

 

We wanted to bring the external page into the original form page so we just copy and pasted the code in and it wasn't working.

 

We commented everything out and it turned out it didn't like two mysql_close in the same page.  Why is that if the first connection is already closed?

 

I know it's better to use include files for connecting to the database but we are going slowly and learning one step at a time.

Link to comment
https://forums.phpfreaks.com/topic/215926-mysql_close/
Share on other sites

If your learning, then it's worth remembering this:-

 

(quote from the manual, the paragraph underneath the quote that chintansshah posted..)

 

Using mysql_close() isn't usually necessary, as non-persistent open links are automatically closed at the end of the script's execution.

 

mysql_close()

 

Though this is dependant on the context of your script.

 

Rw

Link to comment
https://forums.phpfreaks.com/topic/215926-mysql_close/#findComment-1122438
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.