Page 1 of 1

I'm mysql stupid.

Posted: Sun Feb 25, 2007 5:46 pm
by serfczar_
I was looking through my database yesterday, and I stumbled upon a wordpress table. I got to looking in it, and I found some dropdown menus of specific values that the key could be. I want to know how to tell mysql that a certain key within a table can only be one of so many values, for example.

-->Userlocation
---------------------->products
---------------------->index
---------------------->forums
---------------------->news
---------------------->rss feeds



Anyone have a clue?

Posted: Sun Feb 25, 2007 6:44 pm
by jayshields
There is a name for what you are talking about, but for the life of me I can't remember it, or whether it's MySQL that supports it. Either way, I leave things like that to PHP rather than MySQL.

Posted: Sun Feb 25, 2007 7:26 pm
by serfczar_
jayshields wrote:There is a name for what you are talking about, but for the life of me I can't remember it, or whether it's MySQL that supports it. Either way, I leave things like that to PHP rather than MySQL.
Yea, I want to tell mysql to do that with php.

Posted: Sun Feb 25, 2007 7:32 pm
by feyd
You're looking for the ENUM or SET column type.

Posted: Sun Feb 25, 2007 7:45 pm
by serfczar_
feyd wrote:You're looking for the ENUM or SET column type.
Thanks how do I use enum?

Posted: Sun Feb 25, 2007 7:51 pm
by Kieran Huggins

Posted: Sun Feb 25, 2007 7:51 pm
by feyd
http://dev.mysql.com/enum may be of interest.

Posted: Sun Feb 25, 2007 8:02 pm
by serfczar_
feyd wrote:http://dev.mysql.com/enum may be of interest.
ahh thx once again.