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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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...

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.