ricmetal Posted March 4, 2013 Share Posted March 4, 2013 hi guys i am wondering, how does one set up a database to store information on data that gets changed multiple times, yet it is always possible to go back through all the changes made? for example, wikipedia. it shows us a multitude of changes to the same content. how does one go about storing all this info? and what is the best way to do so? thanks Link to comment https://forums.phpfreaks.com/topic/275212-multiple-update-record-keeping/ Share on other sites More sharing options...
trq Posted March 4, 2013 Share Posted March 4, 2013 One way is to add a *version* column. When you make a change, store a new record, with a higher version than the last one. Then, when viewing data, select the highest version from the database. Link to comment https://forums.phpfreaks.com/topic/275212-multiple-update-record-keeping/#findComment-1416420 Share on other sites More sharing options...
DaveyK Posted March 8, 2013 Share Posted March 8, 2013 If you use a unique identifier (and you should), isnt that enough for a version? If you want the last, just use ORDER BY id DESC and limit the result to 1 row. That should fetch the most recent (highest ID) row. Link to comment https://forums.phpfreaks.com/topic/275212-multiple-update-record-keeping/#findComment-1417492 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.