help with phpmyadmin

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

    help with phpmyadmin

    i tried to create a new table using phpmyadmin, but it gave me an error -
    can anybody see what the problem is, and the correct code i could put into
    the SQL section (kind of like the mysql command line, but in a php page).
    TIA.

    SQL-query :

    CREATE TABLE `faq` (
    `id` INT( 10 ) DEFAULT '0' NOT NULL AUTO_INCREMENT ,
    `question` LONGBLOB( 1000 ) DEFAULT 'question' NOT NULL ,
    `answer` LONGBLOB( 5000 ) DEFAULT 'answer' NOT NULL ,
    PRIMARY KEY ( `id` ) ,
    UNIQUE (
    `question`
    )
    ) COMMENT = 'table of frequently asked questions for FAQ page'

    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
    '(1000) DEFAULT 'question' NOT NULL, `answer` LONGBLOB(5000) DEF
  • martin

    #2
    Re: help with phpmyadmin

    Matthew Robinson <mattyrobinson6 9@hotmail.com> wrote in message news:<pan.2004. 01.10.18.53.31. 21255@hotmail.c om>...[color=blue]
    > i tried to create a new table using phpmyadmin, but it gave me an error -
    > can anybody see what the problem is, and the correct code i could put into
    > the SQL section (kind of like the mysql command line, but in a php page).
    > TIA.
    >
    > SQL-query :
    >
    > CREATE TABLE `faq` (
    > `id` INT( 10 ) DEFAULT '0' NOT NULL AUTO_INCREMENT ,
    > `question` LONGBLOB( 1000 ) DEFAULT 'question' NOT NULL ,
    > `answer` LONGBLOB( 5000 ) DEFAULT 'answer' NOT NULL ,
    > PRIMARY KEY ( `id` ) ,
    > UNIQUE (
    > `question`
    > )
    > ) COMMENT = 'table of frequently asked questions for FAQ page'
    >
    > 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
    > '(1000) DEFAULT 'question' NOT NULL, `answer` LONGBLOB(5000) DEF
    >[/color]

    MySQL bitfield data types don't take size
    or allow default value specifications.
    Like:
    `question` LONGBLOB NOT NULL ,
    `answer` LONGBLOB NOT NULL ,

    Comment

    • Peter Taurins

      #3
      Re: help with phpmyadmin

      From memory, don't put a length attribute on a LONGBLOB.

      Peter.


      "Matthew Robinson" <mattyrobinson6 9@hotmail.com> wrote in message
      news:pan.2004.0 1.10.18.53.31.2 1255@hotmail.co m...[color=blue]
      > i tried to create a new table using phpmyadmin, but it gave me an error -
      > can anybody see what the problem is, and the correct code i could put into
      > the SQL section (kind of like the mysql command line, but in a php page).
      > TIA.
      >
      > SQL-query :
      >
      > CREATE TABLE `faq` (
      > `id` INT( 10 ) DEFAULT '0' NOT NULL AUTO_INCREMENT ,
      > `question` LONGBLOB( 1000 ) DEFAULT 'question' NOT NULL ,
      > `answer` LONGBLOB( 5000 ) DEFAULT 'answer' NOT NULL ,
      > PRIMARY KEY ( `id` ) ,
      > UNIQUE (
      > `question`
      > )
      > ) COMMENT = 'table of frequently asked questions for FAQ page'
      >
      > 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
      > '(1000) DEFAULT 'question' NOT NULL, `answer` LONGBLOB(5000) DEF[/color]


      Comment

      Working...