Results 1 to 11 of 11

Thread: [RESOLVED] Allowing Users to Delete?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2008
    Posts
    790

    Resolved [RESOLVED] Allowing Users to Delete?

    I created a CMS using php/mysql.

    To set up my question...

    Table 1: How_Heard_About_Us
    Users can enter in fields like "Newspaper", "Radio", "TV", etc.

    Table 2: Appointments
    Users enter appt information including the ID as a foreign key from the How_Heard_About_Us table.

    I then have a report that finds all appointments and joins How_Heard_About_Us, kinda like this:

    Code:
    SELECT * FROM Appointments a
    LEFT JOIN How_Heard_About_Us h
    ON a.ID = h.ID
    I have an "Admin" area to my CRM, where users can view the How_Heard_About_Us categories. I allow users to update/delete/add new categories which show up in a dropdown menu on the appts form.

    My question is:

    Is it a bad idea to allow users to DELETE the how heard categories if they are tied to existing appointments?

    Should I somehow restrict the user from deleting the categories that exist in the appointments table?

    Not sure what's best practice...

  2. #2
    Frenzied Member
    Join Date
    Apr 2009
    Location
    CA, USA
    Posts
    1,516

    Re: Allowing Users to Delete?

    I'd say it's up to you, and depends on how valuable that data is. Assuming no other dependencies, the consequence of deleting the How_Heard data is simply that you'll no longer know it. Does that matter to you?

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2008
    Posts
    790

    Re: Allowing Users to Delete?

    Well, I guess I'd just have to make a note to someone who is trying to delete "Newspaper", for instance, that any dependencies will be lost. Adding another new category called "Newspaper" won't re-assign previous lost dependencies.

    If the link is broken, then the Appointments column called How_Heard_ID will contain values that won't join to the How_Heard_About_Us table. So I guess that isn't a big deal, right?

    Thanks.

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2008
    Posts
    790

    Re: Allowing Users to Delete?

    ... not a big deal because I am using LEFT JOIN and not INNER JOIN to bring those tables together.

  5. #5
    Frenzied Member
    Join Date
    Apr 2009
    Location
    CA, USA
    Posts
    1,516

    Re: Allowing Users to Delete?

    ... not a big deal because I am using LEFT JOIN and not INNER JOIN to bring those tables together.
    Exactly; the left join won't break, it just won't get anything from How_Heard. So you just have an empty field.

  6. #6
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Allowing Users to Delete?

    from a usability stand point, it's probably not a big deal... from a data mining/historical perspective... it could be a big deal... if it were me... I wouldn't allow things like that to be deleted... but I'd allow them to be deactivated... the user makign the selection can then only see active options... but for historical/reporting purposes, the data is still there....

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  7. #7
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: Allowing Users to Delete?

    Quote Originally Posted by techgnome View Post
    from a usability stand point, it's probably not a big deal... from a data mining/historical perspective... it could be a big deal... if it were me... I wouldn't allow things like that to be deleted... but I'd allow them to be deactivated... the user makign the selection can then only see active options... but for historical/reporting purposes, the data is still there....

    -tg
    Thats exactly what I was going to suggest. Or another option would be a soft delete, similar to deactivating it from the end user, do not show to either end user or admin. It will still exist in the database but not show up in the admin area or to end users. So then its still there for reporting purposes like tg said.

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2008
    Posts
    790

    Re: Allowing Users to Delete?

    I see. Well, if I allow the users to make the categories Inactive, which I could, then what would happen in a situation where a user adds a category by mistake/adds the wrong category? That's really the main reason I added the delete option.

    I do have a form allowing users to update their categories. If they added a wrong category, they would just have to rename it. That logical?

  9. #9
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Allowing Users to Delete?

    then you let them disable it... or you only allow it to be deleted IF there's nothing else tied to it...

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  10. #10

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2008
    Posts
    790

    Re: Allowing Users to Delete?

    Ok. I am going to allow them to delete if nothing is tied to it. Otherwise they could only disable the categories.

    I have a ton of work to do on that - I have multiple administration options other than How Heard categories.

    Thanks guys.

  11. #11

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2008
    Posts
    790

    Re: Allowing Users to Delete?

    Thanks for the advice. I got this sorted now.

    Users can delete the records if they are not tied to anything else. Otherwise, they can make them inactive.

    Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width