Hello, 
I'm not very experienced with MySql and I'm building a website that deal with 
user profiles. User profiles involves lists of preferences to choose from (for 
example, your contry, your profession, etc.), so the user chooses from a 
drop-down lists. The most natural solution for this is to define the related 
fields sometimes with an ENUM statement, sometimes with a SET statement. 
  And now, the problem comes... the problem is that my site will be available 
in several languages, so it will have several versions, for example, 
www.englishversion.com, www.spanishversion.com, etc. Obviously I will not 
create a different database for each site with the same data in different 
languages. 
  I could define many fields in the same table, suppose in my table Profile, I 
would put fields like country_french_enum, country_english_enum and so on. Each 
one would contain a list of all countries in french, in english, etc. But I 
feel it a little cumbersome and difficult to work with. 
  Another solution whould consist to not define enums or sets at all. Instead I 
could just define tha country field as varchar in the Profile table and create 
a new table with static data, with the following fields or such:
  table name: country_names 
table fields: (country_id, country_name_en, country_name_fr, country_name_es, 
country_name_it, ...)
  So each time a form with a country drop-down list is loaded, it would load 
the country names from country_name table according to the language of the 
site. And when form is submitted, the choosen value would be validated and 
inserted in the country varchar field of profile table. 
  This gives me the advantage of take my profile table simpler and faster. But 
the inconvenient is that now, I have much more field validations to do, I must 
validate each submitted choice, because a varchar field doesn't limit or 
delimit allowed values as ENUM or SET do. If I get speed with the database, I 
actually loses speed with the website or server load. If at one side I simplify 
things, I complicate them in another. 
  So, I wrote this message to get some help and knowing more how these kind of 
issues are solved in real-world situations. 
  Internet has lots of multilanguages database driven websites with similar 
data issues. Surely some standard solution is applied. Do you know any better 
solution than these ones I described? If not, cound you suggest me which is the 
best of the two?
  Thanks, I would appreciate a lot your help. 
   
   Alphonse

 
---------------------------------
Want to start your own business? Learn how on  Yahoo! Small Business. 

Reply via email to