WordPress.org

Forums

The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

WP Transaction with multiple query (1 post)

  1. mhadaily
    Member
    Posted 3 years 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