CodeIgniter transaction, starting it and canceling it in different functions |
[eluser]Otemu[/eluser]
Hi, you could have something like this: Code: function overview(){ The difference between trans_begin() and trans_start() trans_begin() is manual, if a query fails you will need to check if it failed and then decide whether to rollback or do something else, with trans_start if a query fails it will automatically roll back. I don't think you need to use transactions for this however, here is some solutions that think be useful: Quote:1) Your preview script builds a form filled with hidden elements that is populated with the data your user just POSTed; the "Save" button would then submit that form to your processing script. source quote here In your case option 2 probably seems the best option Quote:The principle of draft is that the modifications are not saved and are visible by only creators. This way creators/admin can see the changes, however users will see the published version. Alternatively Option 3 you could cache the saved db query and clear that cached result only on next save. |
Messages In This Thread |
CodeIgniter transaction, starting it and canceling it in different functions - by El Forum - 09-06-2013, 08:17 AM
CodeIgniter transaction, starting it and canceling it in different functions - by El Forum - 09-06-2013, 08:58 AM
CodeIgniter transaction, starting it and canceling it in different functions - by El Forum - 09-06-2013, 09:50 AM
CodeIgniter transaction, starting it and canceling it in different functions - by El Forum - 09-09-2013, 12:51 AM
|