My very 1st MySQL table has a problem

Discussion in 'MySQL' started by Iain, Oct 31, 2006.

  1. #1
    I am completly new to MySQL

    I am using EasyPHP
    I live in France so there are a couple of French words in the problem below

    At the database page I filled in the fields and got the message below:
    Please where is the problem?

    Error
    SQL query:

    CREATE TABLE `udfINFOtable` (

    `ID` VARCHAR( 8 ) UNSIGNED CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL AUTO_INCREMENT PRIMARY KEY ,
    `Nom` VARCHAR( 20 ) UNSIGNED CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
    `Mise à jour` VARCHAR( 9 ) UNSIGNED CHARACTER SET utf8 COLLATE utf8_general_ci NULL ,
    INDEX ( `Nom` ) ,
    FULLTEXT (
    `ID` ,
    `Nom` ,
    `Mise à jour`
    )
    ) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci

    MySQL said:

    #1064 - Erreur de syntaxe près de 'UNSIGNED CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL AUT' à la ligne 1
     
    Iain, Oct 31, 2006 IP
  2. SoKickIt

    SoKickIt Active Member

    Messages:
    305
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    70
    #2
    Replace "Mise à jour" with "Mise_a_jour" or something like that. "Mise à jour" is not a valid column name.
     
    SoKickIt, Nov 1, 2006 IP
  3. Iain

    Iain Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thank you, but that did not work. I got the message below, which is esentially the same as the first time

    Error
    SQL query:

    CREATE TABLE `udfINFOtable` (

    `ID` VARCHAR( 8 ) UNSIGNED CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL AUTO_INCREMENT PRIMARY KEY ,
    `Nom` VARCHAR( 20 ) UNSIGNED CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
    `mise_a_jour` DATE UNSIGNED NULL ,
    INDEX ( `Nom` , `mise_a_jour` ) ,
    FULLTEXT (
    `ID` ,
    `Nom` ,
    `mise_a_jour`
    )
    ) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci

    MySQL said:

    #1064 - Erreur de syntaxe près de 'UNSIGNED CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL AUT' à la ligne 1
     
    Iain, Nov 1, 2006 IP
  4. SoKickIt

    SoKickIt Active Member

    Messages:
    305
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    70
    #4
    Ok, let me take a second look :cool:

    1. ID has to be an integer (unsigned, auto_increment)
    2. "varchar" & "date" can't be "unsigned"
    3. You can't add a fulltext index on ID & mise_a_jour (they would have to be varchar or text columns)


    Try this:



    CREATE TABLE `udfINFOtable` (

    `ID` int( 8 ) UNSIGNED NOT NULL AUTO_INCREMENT,
    `Nom` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
    `mise_a_jour` DATE NULL ,
    PRIMARY KEY ( `ID` ),
    INDEX ( `Nom` , `mise_a_jour` ) ,
    FULLTEXT (
    `Nom`
    )
    ) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci
     
    SoKickIt, Nov 1, 2006 IP
  5. Iain

    Iain Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thank you, that worked, now I have to work out how to get data into my table.

    The books and on-line "beginers" information which I have consulted in English & French all seem to be for "beginers" who are less dumb than me

    Is there a site somewhere for real beginers?
     
    Iain, Nov 1, 2006 IP
  6. SoKickIt

    SoKickIt Active Member

    Messages:
    305
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    70
    #6
    Try w3schools.com.
     
    SoKickIt, Nov 1, 2006 IP
  7. Iain

    Iain Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Thank you

    There seems to be a threshold on the learning curve of SQL which is dificult for newbees to cross. It is great that there are guys like you to help
     
    Iain, Nov 1, 2006 IP
  8. SoKickIt

    SoKickIt Active Member

    Messages:
    305
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    70
    #8
    No problem, we were all newbies once ;)
     
    SoKickIt, Nov 2, 2006 IP
  9. infonote

    infonote Well-Known Member

    Messages:
    4,032
    Likes Received:
    68
    Best Answers:
    0
    Trophy Points:
    160
    #9
    I guess your problem was in the ID field.

    I found this course helpful in the past.

    sqlcourse.com/
     
    infonote, Nov 2, 2006 IP