Jump to content

What is the popular way to 'delete' records?


coupe-r

Recommended Posts

Hi all,

 

I'm just wondering how everyone deletes their records using PHP or if you can give me any recommendations.

 

Not really deleting, but I use UPDATE and change the deleteStatus column value. 

 

What is the best / recommended way, with a customer confirmation?

Whether you actually delete the data, move it off into a separate (eg, backup) table, or just flag it as "deleted" depends on the business.

 

If you need to send a confirmation then you should probably use a flag. If uncontested, you can have a periodic backup routine move the "deleted" data someplace else - for archival purposes.

Thanks for the reply.

 

Currently I use a deleteStatus flag along with a JS confirmation box.  But, I just had a friend test it out and when they click my delete icons, it just runs the PHP code and never pops up a message.  I'm looking for a way around that.

 

I can post my short PHP and JS code if you want, but didn't want to post JS in here since its the PHP forum

If the user has javascript disabled, it won't matter what message you try to pop-up; the code will just execute. If you absolutely must have a confirmation dialog presented to the user, you'd need to write it server-side.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.