(10-09-2020, 12:05 PM)InsiteFX Wrote: Your calling them wrong. To run your queries using transactions you will use the
and
PHP Code:
$this->db->transComplete();
You do not call them using your model.
I tried that originally when I reviewed the documentation, but when I do an Error Exception Undefined property: App\Controllers\Properties::$db occurs. I am calling it from my controller.
Okay, I realized that I had not loaded the database connection in the BaseController. I added this to the constructor:
PHP Code:
$this->db = \Config\Database::connect();
The Error Exception is now gone, however, the first record is still being inserted when I force the second query to fail.