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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:38:52+00:00 2026-05-13T09:38:52+00:00

I was recently told that I should use transactions in my application as they

  • 0

I was recently told that I should use transactions in my application as they can help run code quicker and prevent MySQL code from executing before a whole page has loaded (e.g. if someone is just refreshing on my page and the whole page doesn’t load, no MySQL calls will start and it reduces load on the server.)

I’m wondering if I wanted to switch my site to transactions, how difficult would this be, and what changes would I have to make?

Also, I’m using PDO as opposed to mysql_*, if that would make any difference?

  • 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-13T09:38:52+00:00Added an answer on May 13, 2026 at 9:38 am

    Transactions, in web applications, are generally used for Atomicity and for Isolation.

    They don’t “prevent MySQL code from executing before a whole page has loaded” : MySQL queries are still executed when you call mysql_query (or any equivalent using PDO or mysqli_*). But they will all be “cancelled” if you do not commit the transaction.

    They also don’t have that much to do with helping “run code quicker” ; even if they can sometimes have that effect, it’s only because if you don’t explicitly use a transaction for a group of queries (resulting in only one transaction), MySQL will implicitly use one transaction for each query (resulting in several transactions, which might put some additionnal load on the DB server)

    Notes :

    • of course, this is using a DB engine that supports transactions — like InnoDB.
    • for the “quicker” point, I’ve seen it a couple of times ; but it was in special situations, where I needed speed more than ACID — or maybe it was just a matter of load on the server (which means if you want to go down that path, you have to profile, to know what’s faster in your specific case ! )

    Using PDO, mysql_*, or mysqli_* shouldn’t make much of a difference, here — even if it’s recommended not to use mysql_* (old, and doesn’t support some features of MySQL >= 4.1, such as prepared statements).

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

Sidebar

Related Questions

I was recently told that I should keep my code in separate files; like
I have been told recently that extending the Application Class in order to use
I was recently told that it is not recomended to use the LIKE keyword
I recently discovered that one can copy over an assembly that is in use
I've been told recently a good practice in object oriented programming that you should
Someone recently told me that Scala's traits aren't true traits, and that they were
Recently I had been told that prolog can create a graphical display, and told
I work at an eCommerce company. Our DBA recently told me that using SQL
A consultant told me recently that he has clients using IIS. Those servers accept
I recently found an article online that told me about this: RewriteRule ^mock-up/([^/]+)/([^/]+) /mock-up/index.php?page=$1&section=$2

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.