Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9250719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:30:51+00:00 2026-06-18T10:30:51+00:00

I’m looking for a solution to storing and retrieving user entered data as a

  • 0

I’m looking for a solution to storing and retrieving user entered data as a drop down list.


The user wants to start with an existing drop list containing values of breeds.

Breed Select List

<select>
<option value="0">select</option>
<option value="1">Afghan Hound</option>
<option value="2">Airedale Terrier</option>
<option value="3">American Bulldog</option>
<option value="4">Belgian Malinois</option>
</select>

A breed Table exists

|breed_id|  breed_title   |
---------------------------
|   1    |  Afghan Hound  |
|   2    |Airedale Terrier|
|   3    |American Bulldog|
|   4    |Belgian Malinois|

The breed_id value will be saved with the pet values

|pet_id| pet_name | pet_sex |breed_id|
--------------------------------------
|  1   | 'Foo Foo'|   'M'   |    2   |
|  2   | 'Sparky' |   'f'   |    4   |
|  3   |  'Spot'  |   'M'   |    1   |

Because there are so many different types of breeds and because of the potential for entering erroneous breed types – The user wants to be able to add, edit and DELETE breed types.

I can see that I can edit and add breed types in/to the breed table. But what if the user deletes a breed, lets say breed #2:

|breed_id|  breed_title   |
---------------------------
|   1    |  Afghan Hound  |
|   3    |American Bulldog|
|   4    |Belgian Malinois|

The pets association to that breed is lost:

|pet_id| pet_name | pet_sex |breed_id|
--------------------------------------
|  1   | 'Foo Foo'|   'M'   |   (2)  |<<<<<<<
|  2   | 'Sparky' |   'f'   |    4   |
|  3   |  'Spot'  |   'M'   |    1   |

What do I do about the association between a pet that has a breed_id that has been deleted from the breed table?

The next time the pet is called and I try to populate the Breed Select List – breed #2 is gone. What do I do with that pets breed now? How do I populate my drop list now?


I can think of a few ways to handle this – but I am not sure of correct solution – or best practice.

I realize that there may be more a, logic or data entry method, type of solution. Whatever the solution is – I just want to know how the pro’s handle this sort of thing.

Thank you : )

Regards

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T10:30:53+00:00Added an answer on June 18, 2026 at 10:30 am

    How to handle dogs which reference deleted breeds would depend on why the breed needed to be changed.

    Each different reason will have a different outcome as they are trying to achieve different things. A few are:

    1. A breed was mis-spelt or renamed
    2. Two breeds are actually one
    3. An errant (non existant) breed was created

    I would suggest the following behaviour for each case

    1. Rename simply update the existing breed table, being able to do this is one of the primary motivations of normalising the breed data in the first place.

    2. Merging, If you decide ‘Afghan Hound’, and ‘Kuchi Hound’ are actually the same breed, then you would first change all the dogs which are referencing ‘Afghan Hound’ to instead reference ‘Kuchi Hound’ then you can delete the ‘Afghan Hound’ breed without worrying about dangling references.

    3. Delete, say a breed ‘Yo Mama’ was created, if you decide that the dogs which are of this breed type are also not desired, you can first delete all the dogs which reference ‘Yo Mama’ then the breed. If you wanted to keep the dogs, I would suggest creating an ‘unknown’ breed type, or making the breed NULLable, and set the breed of all the ‘Yo Mama’ dogs to NULL before deleting the breed.

    Either way, these outcomes will depend on the type of behaviour you want for you specific system, but I hope this gives you an idea of some common types of migrations.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Specifically, suppose I start with the string string =hello \'i am \' me And
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I've tracked down a weird MySQL problem to the two different ways I was
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I want to construct a data frame in an Rcpp function, but when I
I need to clean up various Word 'smart' characters in user input, including but
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.