views:

43

answers:

1

In this, I would see Readme, but the value would be set to 1

Is this possible?

edit; Sorry. Basically I have a site. It's navigation is in the database. It need to display nav items depening on the users state, like, logged in , admin, blogger, not loggin, and indepenant. These work, however I would like to move from numerical values to human readable. I would like to keep my script the same. So, basicly, can I make the enum Test equal to 1, like a php array?

+1  A: 

The interface you're using has no way of assigning symbolic names to values like you describe.

However, you can use a lookup table so you can associate a string name with each numeric value. That is, you can continue to store values like -1, 0, 1, 2, 3 in your database table, but you would create another table to map those values into strings. Then when you want to show the human-readable names, you would do that as a join to the lookup table.

Bill Karwin
Ok. Thanks. I just ended changing my script.
InsanityNet