Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 928035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:56:42+00:00 2026-05-15T19:56:42+00:00

Is it necessary to explicitly close a DB connection after executing a query (and

  • 0

Is it necessary to explicitly close a DB connection after executing a query (and other DB operation)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T19:56:44+00:00Added an answer on May 15, 2026 at 7:56 pm

    Nope, unless you’re sure you’ve finished communicating with the database for the script run. Even then, you don’t need to close it explicitly at all as PHP does that automatically after your script finishes executing, unless you’re using mysql_pconnect() to connect to your database.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What is minimal framework (necessary methods) of complex object (with explicitly malloced internal data),
Just some food for thought about how necessary it is to close the files
Should I explicitly set thread reference to null after thread completes it's work or
Do I have to explicitly close session before redirecting to another page? session_start(); if
When working with programmatic transactions in Hibernate, is it necessary to explicitly call rollback
After opening an XMPP Chat using the Smack library, is it necessary (or even
Empirically it seems that flush() is not necessary after findAndUpdate() , I just couldn't
I remember that it was (still is?) necessary in MonoTouch to keep explicit references
not necessary an UML diagram, just a simple way to graphically document the relations
I'm struggle extracting necessary data from this json stored inside php variable. Not yet

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.