In CodeIgniter, how can you roll back a transaction in case of an error?
- $this->db->commit();
- $this->db->rollback();
- $this->db->trans_commit();
- $this->db->trans_rollback();
In CodeIgniter, you can roll back a transaction in case of an error using the $this->db->trans_rollback(); method. This function will undo all queries run after the trans_start() method was called.
Loading...
Related Quiz
- What is the role of hooks in modifying the behavior of CodeIgniter controllers?
- How does custom error handling in CodeIgniter enhance security?
- In a news portal developed with CodeIgniter, a developer needs to implement pagination for the latest news section. The challenge is to optimize load times for thousands of news items. The most efficient approach involves ________.
- How does token-based validation in forms help in preventing CSRF attacks?
- Which file in CodeIgniter is used to set up database connection details?