hi to all,
i want to insert data into enum fields but i am not able to insert values. can any one help me regarding this
regards
hi to all,
i want to insert data into enum fields but i am not able to insert values. can any one help me regarding this
regards
Last edited by janunme; 05-07-2007 at 08:20 AM.
whats an enum field?
I'm not sure of the specifics of enum, but it's a certain type of field.
INSERT INTO `field`.... would be the query, like any other field.
However, it may relate to the specific type of data it can support, so you will need to check the length and type of data to be sure it's supported.
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
it is a datatype in mysql
There is nothing special about updating enum columns beyond what's mentioned in the MySQL manual.
For example, given the definition:
  ENUM('a', 'b', 'c')
for a column named enum, the query:
  INSERT INTO table (`enum`) VALUES ('a')
will add the value 'a'. Using a number will index the enumeration:
  INSERT INTO table (`enum`) VALUES (3)
The query above will add the value 'c'.
Mike
I recently have been looking into this.
Depending on how the column is setup.
Will determine if you can just enter data into the column itself.
If it is a enum list that is within the design of the table column attributes.
And that syntax will not work.
That is the exact problem i am trying to solve at the moment.
Seems phpmyadmin will allow a alter statement of the enum attributes but will not allow direct data entry into the row.
As a enum column is a list it needs to be altered at the design state not just normal data entry.
Wish i could find a proper syntax for this.
You mean to say you're trying to update the possible values of the enum field with a query? That's an abuse of enum, don't do it. If you're going to be creating your own values, just use a text field of some kind.
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Thank you very much MWinter Sir, i have been searching the solution to this query from more than 2 weeks. i have 10 such enum fields. and now my project is working fine
Bookmarks