phpmyadmin error #1064

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

    #1

    phpmyadmin error #1064

    I am trying to use phpmyadmin to make a new table. Here's the query
    it created. What am I doing wrong?

    SQL-query :

    CREATE TABLE `News` (

    `ID` INT( 11 ) DEFAULT '0' NOT NULL AUTO_INCREMENT ,
    `Headline` TINYTEXT( 255 ) NOT NULL ,
    `Opener` TINYTEXT( 255 ) NOT NULL ,
    `Story` TEXT NOT NULL ,
    `Image` TINYTEXT( 255 ) NOT NULL ,
    UNIQUE (
    `ID`
    )
    )

    MySQL said:


    #1064 - You have an error in your SQL syntax. Check the manual that
    corresponds to your MySQL server version for the right syntax to use
    near '(255) NOT NULL, `Opener` TINYTEXT(255) NOT NULL, `Story` TEXT N
  • Ian.H

    #2
    Re: phpmyadmin error #1064

    On Mon, 26 Jul 2004 19:24:59 -0700, Don Seckler wrote:
    [color=blue]
    > I am trying to use phpmyadmin to make a new table. Here's the query
    > it created. What am I doing wrong?
    >
    > SQL-query :
    >
    > CREATE TABLE `News` (
    >
    > `ID` INT( 11 ) DEFAULT '0' NOT NULL AUTO_INCREMENT ,
    > `Headline` TINYTEXT( 255 ) NOT NULL ,
    > `Opener` TINYTEXT( 255 ) NOT NULL ,
    > `Story` TEXT NOT NULL ,
    > `Image` TINYTEXT( 255 ) NOT NULL ,
    > UNIQUE (
    > `ID`
    > )
    > )
    >
    > MySQL said:
    >
    >
    > #1064 - You have an error in your SQL syntax. Check the manual that
    > corresponds to your MySQL server version for the right syntax to use
    > near '(255) NOT NULL, `Opener` TINYTEXT(255) NOT NULL, `Story` TEXT N[/color]


    Try changing TINYTEXT() to VARCHAR() =)



    Regards,

    Ian

    --
    Ian.H
    digiServ Network
    London, UK


    Comment

    • Don Seckler

      #3
      Re: phpmyadmin error #1064

      Anyone?

      djseckler@hotma il.com (Don Seckler) wrote in message news:<fe6bb0b0. 0407261824.44fc db2f@posting.go ogle.com>...[color=blue]
      > I am trying to use phpmyadmin to make a new table. Here's the query
      > it created. What am I doing wrong?
      >
      > SQL-query :
      >
      > CREATE TABLE `News` (
      >
      > `ID` INT( 11 ) DEFAULT '0' NOT NULL AUTO_INCREMENT ,
      > `Headline` TINYTEXT( 255 ) NOT NULL ,
      > `Opener` TINYTEXT( 255 ) NOT NULL ,
      > `Story` TEXT NOT NULL ,
      > `Image` TINYTEXT( 255 ) NOT NULL ,
      > UNIQUE (
      > `ID`
      > )
      > )
      >
      > MySQL said:
      >
      >
      > #1064 - You have an error in your SQL syntax. Check the manual that
      > corresponds to your MySQL server version for the right syntax to use
      > near '(255) NOT NULL, `Opener` TINYTEXT(255) NOT NULL, `Story` TEXT N[/color]

      Comment

      • Ian.H

        #4
        Re: phpmyadmin error #1064

        On Tue, 27 Jul 2004 16:25:09 -0700, Don Seckler wrote:


        [ snip ]

        [color=blue][color=green]
        >> #1064 - You have an error in your SQL syntax. Check the manual that
        >> corresponds to your MySQL server version for the right syntax to use
        >> near '(255) NOT NULL, `Opener` TINYTEXT(255) NOT NULL, `Story` TEXT N[/color][/color]


        Just rechecked this... remove the values '255' for TINYTEXT.. should
        fix the problem. *TEXT fields don't take length values =)



        Regards,

        Ian

        --
        Ian.H
        digiServ Network
        London, UK


        Comment

        • Don Seckler

          #5
          Re: phpmyadmin error #1064

          I found the answer. You shouldn't indicate a feild size for TEXT or
          TINYTEXT field types.

          Comment

          • Ian.H

            #6
            Re: phpmyadmin error #1064

            On Wed, 28 Jul 2004 13:44:40 -0700, Don Seckler wrote:
            [color=blue]
            > I found the answer. You shouldn't indicate a feild size for TEXT or
            > TINYTEXT field types.[/color]


            As per my 2nd reply ;)



            Regards,

            Ian

            --
            Ian.H
            digiServ Network
            London, UK


            Comment

            • Diz
              New Member
              • Feb 2006
              • 19

              #7
              on the same subject..why doesn't it like this table? I'm very new to this and have been seaching all day for field the definitions, not sure if i have used the right ones?

              SQL-query:

              CREATE TABLE `artwork` (

              `artworkID` INT( 10 ) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT ,
              `title` VARCHAR( 25 ) UNSIGNED NOT NULL ,
              `category` VARCHAR( 25 ) UNSIGNED NOT NULL ,
              `dateCreated` YEAR( 4 ) UNSIGNED ZEROFILL NOT NULL ,
              `forSale` VARCHAR( 5 ) UNSIGNED NOT NULL ,
              `size` VARCHAR( 20 ) UNSIGNED NOT NULL ,
              PRIMARY KEY ( `artworkID` ) ,
              INDEX ( `title` , `category` ) ,
              FULLTEXT (
              `title` ,
              `category`
              )
              )

              Comment

              Working...