Revising Function - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Revising Function (/showthread.php?tid=56180) |
Revising Function - El Forum - 12-01-2012 [eluser]xtremer360[/eluser] I'm trying to figure out what would be the best route in handling the situation of what would happen if the title is created but then the second insert doesn't get ran successfully. What are some possibilities? Code: /** Revising Function - El Forum - 12-13-2012 [eluser]apodner[/eluser] You can just basically roll the first insert back if the 2nd one fails. Code: public function save_title($title_name, $title_directory_name, $title_status_id) Revising Function - El Forum - 12-14-2012 [eluser]CroNiX[/eluser] This is what transactions are for. |