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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:20:14+00:00 2026-05-29T10:20:14+00:00

Database is MySQL. I am looking to implement a trigger that updates an aggregate

  • 0

Database is MySQL. I am looking to implement a trigger that updates an aggregate rating table whenever a new rating is placed. Then there are some other similar use cases where I’m looking to implement triggers.

These triggers may be updating federated tables. So my question is:
whether a php script that inserts a new rating will need to wait for the trigger to complete before the php script completes?

PS: I understand triggers is not a good idea to put logic, and may be I would be better off with some messaging such as RabbitMQ.

  • 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-29T10:20:14+00:00Added an answer on May 29, 2026 at 10:20 am

    Triggers are synchronous; the INSERT/UPDATE/DELETE that spawned them blocks until the trigger completes executing, including any actions the trigger executes (and even any subsequent triggers spawned by those actions).

    Triggers are atomic. That is, if any change executed by the trigger fails, then the trigger fails, and it also cancels the change that spawned the trigger.

    Triggers also make changes in the scope of the same transaction that spawned the trigger. So changes made by the trigger can be committed/rolled back along with the changes that spawned the trigger. If triggers kept running while your PHP app finishes its transaction and exits, then there would be no way to ensure they happen in that transaction.

    This applies both to BEFORE triggers and AFTER triggers. Your app blocks until all triggers are finished.

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

Sidebar

Related Questions

There is a MySql database looking like this: Id / name / hobby /
I was just looking at the MySql database created by drupal after I installed
I'm looking at implementing a failover mechanism for a MySQL database using MySQL Proxy
Looking for a good tutorial on how to update a mysql database using a
I'm looking to implement fuzzy search for a small PHP/MySQL application. Specifically, I have
I'm looking for a way to create a simple HTML table that can be
I am looking for a way to know which rows in a database (mysql)
I am looking to store data from a form in a mysql database and
I am using node.js to query a MySQL database table every 10 seconds. Using
I been looking at some database (MySQL) wrapper classes, A lot of them work

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.