www.webdeveloper.com
Results 1 to 5 of 5

Thread: Whether mysql connection will last until we close that page?

  1. #1
    Join Date
    Feb 2009
    Posts
    3

    Exclamation Whether mysql connection will last until we close that page?

    Hi, suppose if we are connecting to a database using mysql_connect ...
    That connection will last until we go to the next page or close that page??????
    And one more doubt is that after every transaction or commit the connection to the database will terminate?

  2. #2
    Join Date
    Jun 2003
    Location
    here
    Posts
    4,551
    The connection lasts till the end of the PHP code, it's closed with mysql_close, or, in the case of persistent connections until the connection is forced to close.

  3. #3
    Join Date
    Feb 2009
    Posts
    3

    Post Thanks.. one more to ask

    PHP Code:
    Please be specify that suppose we run a mysql_query and after  that mysql_fetch_assoc.. I need to ask that after this execution whether our mysql connection will end up??? 

  4. #4
    Join Date
    Jun 2003
    Location
    here
    Posts
    4,551
    Erm, using the forums php code tags for normal text, that's intresting :P

    As I said, the connection will stay open until the end of the page execution(where PHP does this automatically as a part of the clean up), you close it yourself( mysql_close() ).

    It does not close just because you've run a query or read any results.

  5. #5
    Join Date
    Feb 2009
    Posts
    3

    okkkkk thanksss

    oh okkkkk im new to this forum.... anyways thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles