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 9271605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:39:46+00:00 2026-06-18T15:39:46+00:00

I have my own database which I’m running using Xampp. I’m using the Apache

  • 0

I have my own database which I’m running using Xampp. I’m using the Apache and MySql services on it, though I given public access just yet. I would like to know the proper way to end a bunch of sql queries. I’m using ajax to send data to a php page and query some data from a server. During the ajax requests the I programmed the handler php page so it will be performing multiple queries (at least more than one) to get the specific data I need. Now, I don’t know when in the process I should use mysqli_kill() or mysqli_close(). I have it set up right now so only after all the immediate queries for that particular ajax request have been performed, then run mysqli_close(). I don’t even use mysqli_kill(). I don’t know too much about database connections or managing performance on a server so I don’t know how to consider this. On one hand, I don’t need to close the connection until that user logs off the webpage, right? Or should I just open and close each connection as it comes and is processed?

This handler php page processes requests from a few webpages I have and in one of the webpages there is an input box that sends ajax requests every keystroke to show hints (possible matches)… also note this is an employee access only page so connections shouldn’t be too high.

I also took a look at this post Could someone explain a little about this statement about mysqli close function?

The answer is contradictory to the suggestion taken from the php manual website. Would someone please clarify when to use mysqli_kill() and mysqli_close() as well if, for the circumstances I described, there would be any reason to keep a connection alive for the sake of performance?

  • 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-06-18T15:39:47+00:00Added an answer on June 18, 2026 at 3:39 pm

    In general, you do not need to use either of these functions at all. All resources that the server has allocated to you will be released automatically when the PHP script finishes executing, so in the most common scenario there is nothing you should be concerned about.

    Sometimes you might want to use mysqli_close, for example inside a long-running script that has done what it needs to do with the database and does not wish to tie up server resources for the remainder of its execution.

    You should never have need to use mysqli_kill at all: what this function does is instruct the server to destroy a worker thread. This is getting into “mucking around where you are not invited” territory, which might be useful in some situations but certainly never under normal operation.

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

Sidebar

Related Questions

I have several servers running their own instance of a particular MySQL database which
I have my own custom Content Provider that loads a database which contains the
I have a mysql database which has grown to over 200 tables in it.
I have a Yahoo! Group that has its own Database tables for various reasons.
I'm implementing a service where each user must have his own json/document database. Beyond
I have SSRS report with its own datasets coming straight from the database. I
I have own component which works in my testing winform app good but when
I'm trying to hide window after its startup. I have own window-class which is
I have a database which has a table with an XML column. The XML
I have to work with a database which keeps a track of instances of

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.