php - Maintain order of records after soft delete -


I have created a soft deleted system for a table that contains the following columns:

  Sample data (3 rows):  
  1 section Dd1x1 - ID (Auto increment 1) - Category - Title - Is_Deleted - Timestamp (Created)  
< P> Sample data (3 rows) 0 2014-10-24 18:41:54 2 Logistics L2x14 0 2014-10-24 16:55:27 3 Transit T4 These 3 2014-10-24 17:09:27 < / Code>

Also work on soft delays while updating a record Are ready for. (business requirement). If I update "department data" from "department" then I do this with:

  update categories_most SET Is_Deleted = 1 WHERE id = 1; Enter the categories _ most recent (Category, Title, Encoded) values ​​('Department Data', 'DD1x1', 0);  

This code works fine, but when I display this data in the frontend, it changes the order of the records due to the order of the ID The only way to think about getting around it is to have an extra column with any type of "order" variable, which must be sorted before retrieving the query.

Is there any easy way to handle the problem, and allow the order of records to remain unchanged?

Instead of adding a new record, you can save your last value in any other column to make this unnecessary record Will be used, the order will be similar.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -