Home > Mobile >  Is it okay to display records in a table with broken ID because of delete
Is it okay to display records in a table with broken ID because of delete

Time:05-02

I have searched everywhere and couldn't find the answer. What is the standard in displaying a records from database in front end? For example, I want to display records from a table in database but some of its records are already deleted and now it will show in the backend or in admin with broken count of id such as

1 2 4 5 6

Is it okay display it like this?

CodePudding user response:

It kinda depends on what the client want, but in general:

  • the deleted records are just left out from the listing on data (of which the ID might be part of)
  • usually you do not actually physically remove the entry, but instead set "deleted" status and exclude them in SQL query
  • when you are listing entries like invoices, you often do not have the ID matching the invoice number, since those invoice numbers will probably have their own business-rules for generating them

CodePudding user response:

don't show its id's from database rather show its id index (which always start from 0) then make it increment by 1

  • Related