Alan Lord wrote:

Imagine a database table, field defined as ENUM with a list of allowed types
such as
"Mr", "Mrs", "Miss", "Dr", "Prof", etc - you get the idea.

I've read the MySQL manual and by using

SHOW COLUMNS FROM "table_name" LIKE "enum_column_name";

I can get a result.

But the string of ENUMs is not an array. It is returned as a string with all
types in one string.

Anyone got any ideas about how to retrieve it in a better way - else I'll
need to start exploding the string...

That's the best you're going to get. Read the string and explode() it into an array. That's the only method and why ENUM/SET columns are a PITA. You should be validating the data prior to it going in the database, anyhow, so why have the additional complexity of the ENUM/SET column?


--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to