Do I need to close MySQLi connections?

Discussion in 'PHP' started by thing2b, Mar 3, 2008.

?

Should I close MySQLi connections at the end of a script?

  1. Yes

    0 vote(s)
    0.0%
  2. No

    0 vote(s)
    0.0%
  3. Not sure

    2 vote(s)
    100.0%
  1. #1
    If I make connections with the MySQLi PHP module, is there any point of closing connections when the script is ending?

    If I am at the end of the PHP script, should I just leave the connections open?
     
    thing2b, Mar 3, 2008 IP
  2. lephron

    lephron Active Member

    Messages:
    204
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #2
    They will close at the end of the file automatically, only persistent connections will remain open until you explicitly close them - so no, you don't need to
     
    lephron, Mar 4, 2008 IP