简体   繁体   中英

codeigniter save any transactions

I'm using codeigniter and my sql DB in my system

I'm tried to find a solution to my problem is : in update my record in database i want Keep the record before editing it In order to be presented in the end of year report and The calculations of the year are done correctly What is the best way to do this ?

when a database record is updated you cannot fetch the old record. What you can do is to create another table and insert the record in there before editing it.

Assuming you have a table in your database, "table A" which is the table you are currently updating, create another table, "table B" that you will be saving the actual data you feel will be needed to do the yearly calculations. Do not forget to add a year column on "table B".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM