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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:28:22+00:00 2026-05-26T03:28:22+00:00

So what am I doing wrong? When I run the following code, the database

  • 0

So what am I doing wrong? When I run the following code, the database is always updated even though transactions is in test mode.

/**
 * update_batch
 * This updates multiple rows. The data array must include the game_id and game_type_prize_id
 * @param array
 * @return bool
 * @author zechdc
 */
function update_batch($data)
{
    $result = TRUE;

    foreach($data as $prize)
    {
        $this->db->trans_start(TRUE); //first param is set to TRUE for test mode.
        $this->db->where('game_id', $prize['game_id']);
        $this->db->where('game_type_prize_id', $prize['game_type_prize_id']);
        $this->db->update('game_prizes', $prize);
        $this->db->trans_complete();

        if($this->db->affected_rows() == -1)
        {
            $result = FALSE;
        }
    }


    return $result;
}
  • 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-26T03:28:22+00:00Added an answer on May 26, 2026 at 3:28 am

    AbhishekDilliwal provided us with the answer in his comments. If he posts the answer I will delete mine and accept his so he gets credit instead of me.


    Answer:

    Codeigniter Transactions Test Mode Currently Does Not Work.


    Solution:

    Replace:

    $this->_trans_failure = ($test_mode === TRUE) ? TRUE : FALSE;
    

    with:

    $this->_trans_status = ($test_mode === TRUE) ? FALSE : $this->_trans_status;
    

    in the following codeigniter system files:

    system/database/drivers/mysql/mysql_driver.php
    system/database/drivers/mysqli/mysqli_driver.php
    system/database/drivers/oci8/oci8_driver.php
    system/database/drivers/odbc/odbc_driver.php
    system/database/drivers/postgre/postgre_driver.php
    system/database/drivers/sqlite/sqlite_driver.php
    

    It looks like rommelxcastro submitted the fix to the github repo already. Now we just have to wait for Codeigniter to pull it and release a new version 🙂


    Sources:

    • Abhishek Dilliwal’s comment
    • https://github.com/EllisLab/CodeIgniter/issues/5
    • https://github.com/rommelxcastro/CodeIgniter/commit/6f4ffeb35fdc06024c63de0fc929566140b8176a
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What am I doing wrong in this HTML code: <html> <head> </head> <body> <div
When I run the following code, nothing gets copied - what am I doing
What am I doing wrong with this: $sql = SELECT * FROM content WHERE
What am I doing wrong to get this error? replacements = {} replacements[**] =
I've tried to run the following code on Komodo IDE (for python): import unittest
When you run the following code, StatusCode is returned as null. What am I
I am trying to run the following code, taken from the Facebook developer site.
I am trying to run the following code within SQLPlus: exec lbacsys.sa_sysdba.create_policy(policy_name => 'ACCESS_LOCATIONS',
I'm trying to run the following code on a website to set up the
I'm sure I'm doing something stupid here, but the following code: ... public void

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.