Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-7034

sql error lost in transactions

    XMLWordPrintable

Details

    Description

      The following code outputs 0 instead of the right db error code.

      $db->sql_return_on_error(true);
      $db->sql_transaction('begin');
      if (!$db->sql_query('this will fail')) {
          $error = $db->sql_error();
          echo $error['code'];
      }

      sql_query calls sql_error in case of an error which makes silently a rollback without preserving the reason for the error. (Tested with mysqli layer only)

      Attachments

        Activity

          People

            Kellanved Kellanved [X] (Inactive)
            flystop flystop
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: