Dumbass question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jay

    #1

    Dumbass question

    Can you tell me why this isn't working? It's generated by easyphp 1.6 -
    myphpadmin. it's driving me bonkers!I go to create a table and this is the
    error I get...Thx in advance!CREATE TABLE `customer` (`id` INT(11) NOT NULL
    AUTO_INCREMENT PRIMARY KEY, `fname` TEXT(9), `lname` TEXT(9))MySQL said:

    You have an error in your SQL syntax near '(9), `lname` TEXT(9))' at line 1


  • Andy Hassall

    #2
    Re: Dumbass question

    On Sun, 4 Jan 2004 09:36:40 +1000, "Jay" <gybrid@hotmail .com> wrote:

    Subject: Dumbass question

    (Please use the subject line to describe the subject of your post...)
    [color=blue]
    >Can you tell me why this isn't working? It's generated by easyphp 1.6 -
    >myphpadmin. it's driving me bonkers!I go to create a table and this is the
    >error I get...Thx in advance!CREATE TABLE `customer` (`id` INT(11) NOT NULL
    >AUTO_INCREME NT PRIMARY KEY, `fname` TEXT(9), `lname` TEXT(9))MySQL said:
    >
    >You have an error in your SQL syntax near '(9), `lname` TEXT(9))' at line 1[/color]

    You can't specify length restrictions on TEXT fields. Sounds like you want
    VARCHAR(9) instead.

    http://www.mysql.com/documentation/m...l#String_types
    http://www.mysql.com/documentation/m...l#CREATE_TABLE

    --
    Andy Hassall (andy@andyh.co. uk) icq(5747695) (http://www.andyh.co.uk)
    Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)

    Comment

    • Jay

      #3
      Re: Dumbass question

      Nevermind - I got it... You dont put down the length in the text fields.


      "Jay" <gybrid@hotmail .com> wrote in message
      news:bt7gvb$2cj u$1@bigblue.net .au...[color=blue]
      > Can you tell me why this isn't working? It's generated by easyphp 1.6 -
      > myphpadmin. it's driving me bonkers!I go to create a table and this is the
      > error I get...Thx in advance!CREATE TABLE `customer` (`id` INT(11) NOT[/color]
      NULL[color=blue]
      > AUTO_INCREMENT PRIMARY KEY, `fname` TEXT(9), `lname` TEXT(9))MySQL said:
      >
      > You have an error in your SQL syntax near '(9), `lname` TEXT(9))' at line[/color]
      1[color=blue]
      >
      >[/color]


      Comment

      • Jeremy Shovan

        #4
        Re: Dumbass question

        Try this:
        create table customer {
        id int(11) not null auto_increment primary key,
        fname varchar(9),
        lname varchar(9)
        }

        Jeremy Shovan
        Image 2020
        Foundation X

        Jay wrote:
        [color=blue]
        > Can you tell me why this isn't working? It's generated by easyphp 1.6 -
        > myphpadmin. it's driving me bonkers!I go to create a table and this is the
        > error I get...Thx in advance![/color]

        CREATE TABLE `customer` (
        `id` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
        `fname` TEXT(9),
        `lname` TEXT(9)
        )


        MySQL said:[color=blue]
        >
        > You have an error in your SQL syntax near '(9), `lname` TEXT(9))' at line 1
        >
        >[/color]

        Comment

        Working...