Warning: fopen(graphic_design/files/thread-862-1.txt) [function.fopen]: failed to open stream: Permission denied in /graphic_design/global.php on line 421
file NOT opened MySQL enum and PHP -
PDA

View Full Version : MySQL enum and PHP


Arch Stanton
05-20-2004, 04:40 PM
I've been wanting to use enum column type for a while, but have used small little related tables instead beacause I don't know how to create an easy to use interface for my clients to add and remove available values. If anyone knows of some functions out there for working with enum, could you let me know?

Until then, I'll stick with related tables.

Right now I'm working on a regional events calendar, and the event city will be chosen from a list. Currently I have a list of citiys in a table so the site administrator can add and remove available city's. I think it would work more effeciently with enum.

Octane
05-21-2004, 08:56 AM
Joel,it's not recommended to use ENUM. First, it's not compatable with any other DB. Second, there is no real advantage to it and it's a pain to have to ALTER TABLE everytime you want to add an additional value to the column. Using another table is still the best way that I have found. If you think the query to the extra table takes too much, then use an array in a flat file that is in the format of PHP.

$listval[] = 'val1';
$listval[] = 'val2';


Then, just include that file in the files that need the table.

Arch Stanton
05-21-2004, 09:28 AM
Thanks. I'm going to stick with tables I guess.