I thought maybe there is MySQL command to pull up the last X records that were most recently modified. I know I could just put an extra field in that stores whenever a record is updated.. but I am trying to avoid that route if possible.
Any pointers? I just want to create a dynamic dashboard that allows the clien开发者_StackOverflow中文版t to quickly work with the most recently worked on records..
Ex: "most recent users", "most recent projects", "most recent companies".. etc.
Rather than storing data in the database, you could easily use session or cookie storage.
Create a stack of most recent references with a fixed size and manipulate this when a record is worked on. Your dashboard can then use this stack to display the records.
Why are you trying to avoid storing it in the DB? too much extra data? or too much work? Did you know mysql can auto update the last-mod column?
ALTER TABLE mytable
ADD lastmodified TIMESTAMP
DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP;
精彩评论