WordPress.org

Ready to get started?Download WordPress

Forums

WP Transaction with multiple query (1 post)

  1. mhadaily
    Member
    Posted 1 year ago #

    Hello there,

    Please have a look at below code

    $db = new PDO($dsn, $user, $password);
    $db->beginTransaction();
    try {
      // do your queries here, using PDO and $db object
      $db->commit();
    } catch (PDOException $e) {
      $db->rollback();
    }

    I need to know ,is there any class or function like above to manage transactions for multiple query or something similar ?

    Really appreciate if you can help me.
    Majid

Topic Closed

This topic has been closed to new replies.

About this Topic