Welcome Guest, Not a member yet? Register   Sign In
Database row pseudo-deletion
#1

[eluser]Madmartigan1[/eluser]
Hi guys,

In most of my database tables, I use a field called 'active' for when a user 'deletes' a record.

TINYINT, DEFAULT 1

0 = deleted
1 = not deleted

The sql to select the records will always have 'WHERE active=1', unless for some reason I'm displaying 'deleted' data.

I know this is splitting hairs, but I was wondering if it might be better to use a field called 'deleted' with a default of 0. Is it better to use 'WHERE active != 0' with the first method? It probably makes no difference.

What do you guys usually do? Is there a standard for this technique?


Messages In This Thread
Database row pseudo-deletion - by El Forum - 09-23-2009, 04:45 PM
Database row pseudo-deletion - by El Forum - 09-23-2009, 06:49 PM
Database row pseudo-deletion - by El Forum - 09-24-2009, 02:00 AM



Theme © iAndrew 2016 - Forum software by © MyBB