You are here: Re: Loading values of ENUM out another tabel « PHP SQL « IT news, forums, messages
Re: Loading values of ENUM out another tabel

Posted by Stef on 12/23/06 13:57

"J.O. Aho" <user@example.net> schreef in bericht
news:4v4pehF19fs26U1@mid.individual.net...
> Stef wrote:
>> I was wondering if it is possible to load the values of a ENUM out of
>> antoher table.
>>
>> Example:
>>
>> Table 1
>> id Colors
>> 1 A
>> 2 B
>> 3 C
>>
>> Table 2
>> id car color
>>
>> Would it be possible to set 'color' to an ENUM type and load the
>> different values of color out of table 1?
>
> Was it this you had in mind?
> http://dev.mysql.com/doc/refman/5.0/en/join.html
>
> Works pretty in the same manner/syntax on most real SQL databases.
>
>
> --
>
> //Aho

Well ... I'm not really sure. I've written a CMS where ENUMs are shown as a
pull down list. For the moment these lists have a fixed number of valies
defined in the type field.

Sticking to the example the color column of table 2 would be defined as
enum('A','B','C'). What want to do is making the values inside the enum
depende of the values of the colors column in table 1. In other words ... I
do not know how many values there will be in advance.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация