Jump to content


Photo

Auto-Clean Up for Database?


  • Please log in to reply
1 reply to this topic

#1 meridionale

meridionale
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 13 March 2006 - 05:08 PM

Hi everyone!

I have a website that uses mysql/phpmyadmin for an auto update survey. For the different fields, I have people who enter the same thing but in different ways, for example:

User 1: Econ
User 2: Economics
User 3: Economics Masters

User 1: U of Cal-Berkeley
User 2: Berkeley
User 3: University of California-Berkeley

I'd love a way to clean up how everything looks, because it also affects the sort. So, I'm basicly asking, is there a way for me to put an auto clean up where someone who enters "Econ" automatically has their entry turned to "Economics" or "U of Cal-Berkeley" to "Berkeley" in the database?

Thanks :)


#2 hitman6003

hitman6003
  • Members
  • PipPipPip
  • Advanced Member
  • 1,807 posts

Posted 14 March 2006 - 12:17 AM

Yes, it's called normalization, specifically, third normal form. Do a google search for it.

The over all gist of it is to have a seperate table that stores the values, which those values are presented to the user...so the user can only select the ones that you have presented to them, which elminates them making mistakes.

Aside from normalizing your db, there is no good way of doing what you want "automatically".




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users