TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 11-05-2009, 09:17 AM   #1 (permalink)
Jmz
The Acquainted
 
Join Date: Oct 2007
Location: Newcastle, UK
Posts: 113
Thanks: 3
Jmz is on a distinguished road
Default Deleting rows from a large web app

Say I'm making a web app which will hold a lot of data. If a user chooses to delete something, would you delete the row or use a field to mark that it's been deleted?

Deleting the row will keep the size of the table down and will mean I'm not storing data I don't need but just marking the row deleted will mean nothing is ever really lost, even if the end user can't get it back themselves.

Is there a best practice for situations like this?
__________________
Free CSS Tutorials
Send a message via MSN to Jmz
Jmz is offline  
Reply With Quote
Old 11-05-2009, 04:29 PM   #2 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

You really haven't provided any useful information, what type of system is this? Why would you want to undelete a row? Do you think that the situation would often present itself?
__________________

Village Idiot is offline  
Reply With Quote
Old 11-05-2009, 04:33 PM   #3 (permalink)
Jmz
The Acquainted
 
Join Date: Oct 2007
Location: Newcastle, UK
Posts: 113
Thanks: 3
Jmz is on a distinguished road
Default

I wasn't really thinking of a specific system, I was just wondering what people tend to do in general and why they do it so that I can get a better idea of when I should use each method or if people have a totally different method I haven't thought of.
__________________
Free CSS Tutorials
Send a message via MSN to Jmz
Jmz is offline  
Reply With Quote
Old 11-05-2009, 05:15 PM   #4 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

Quote:
Originally Posted by Jmz View Post
I wasn't really thinking of a specific system, I was just wondering what people tend to do in general and why they do it so that I can get a better idea of when I should use each method or if people have a totally different method I haven't thought of.
It depends on the type of data you are storing. If you want to keep records of that row, you obviously would not want to delete it. But if upon deletion it will never be needed again, delete it.
__________________

Village Idiot is offline  
Reply With Quote
Old 11-06-2009, 03:32 AM   #5 (permalink)
The Contributor
 
Join Date: Jun 2009
Location: Seattle, WA
Posts: 76
Thanks: 1
rguy84 is on a distinguished road
Default

Like VI said, it depend on the system. I know some people in the camp of you never ever delete records.

One thing you can do is make a deleted field.If the said field = 1, it is effectively deteleted in thze users eyes. Remember you will then have to make display queries have a where clause that doesn't display those rows.
__________________
Ryan | Blog | Twitter
Send a message via AIM to rguy84 Send a message via MSN to rguy84 Send a message via Yahoo to rguy84 Send a message via Skype™ to rguy84
rguy84 is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[PHP/MySQL] Function to return ALL selected rows maZtah General 7 10-22-2012 09:41 AM
How to get row number from 2 top numberd rows ttmtake General 5 01-28-2009 11:16 PM
MySQL Buckeling after a million rows? drewbee General 8 05-08-2008 07:41 PM
how to get the rows affected(not number of rows) kororo203 Absolute Beginners 2 04-23-2008 08:32 AM
Notepage like application to open large MySQL files Wildhoney General 6 12-07-2007 02:18 PM


All times are GMT. The time now is 04:25 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design