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

  • Home
  • SEARCH
  • 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 7792047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:04:23+00:00 2026-06-01T22:04:23+00:00

Can someone tell me, when you for example update, insert, delete.. should you then

  • 0

Can someone tell me, when you for example update, insert, delete.. should you then close it like mysqli_stmt::close(); ? I checked PHP manual and don’t understand what close() actually does.

Example:

$stmt = $dbh->prepare("SELECT `user_email` FROM `users` WHERE `user_email` = ? LIMIT 1");
$stmt->execute(array($email));
$stmt->close();

Next part of my question is, if as an example i had multiple update queries in a transaction after every execute() for each query i am executing within the transaction should i close them individually ? … because it’s a transaction not sure i need to use $stmt->close(); after each execute(); or just use one $stmt->close(); after all of them ?

  • 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-01T22:04:25+00:00Added an answer on June 1, 2026 at 10:04 pm

    It seems like you are using mysqli close method. The $stmt->close() methode simply just closes closes the the previous opened database connect (http://www.php.net/manual/en/mysqli.close.php).

    EDIT: If it’s PDO you are using, I simply do not understand, why you dont take advantage of the possibility of having named parametres instead of question marks. That is, why a lot of people choose PDO instead of mysqli – you might have a better comprehensive view of the queries/statements.

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

Sidebar

Related Questions

Can someone tell me please why the following example work in Firefox but not
Can someone tell me why this processes all the files and then does it
In the example below can someone tell me how can i remove the number
Can someone tell me how to update the following code to just get the
Please can some one briefly tell me with example what does the means of
Can someone tell me why when I cast a string of say 00332 I
Can someone tell me how I can make a table be 100% height in
Can someone tell me the difference between: $(document).ready(function() { }); and: var someVar =
Can someone tell me why this http://hupcapstudios.com/projects/calendar.html won't load in IE? The error message:
Can someone tell me whether MSMQ (using transactions) supports competing consumers? Basically, I have

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.