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 Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.