SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    boiler up blackdog's Avatar
    Join Date
    Jul 2002
    Location
    Purdue
    Posts
    1,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    datatype question

    i'm trying to make a field in my table to store articles so i need it to store a large string. i'm using phpmyadmin and i tried making a text datatype with 20000 char max and it says i have an error. anyone know whats wrong? here's the sql:
    Code:
          CREATE  TABLE  `news` ( `day` INT( 2  )  NOT  NULL ,
      `month` INT( 2  )  NOT  NULL ,
      `year` INT( 4  )  NOT  NULL ,
      `article` TEXT( 20000  )  NOT  NULL ,
      `co1` VARCHAR( 50  ) ,
      `co2` VARCHAR( 50  ) ,
      `co3` VARCHAR( 50  ) ,
      `phone1` INT( 7  ) ,
      `phone2` INT( 7  ) 
     ) 
     
      
           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 '(65535) NOT NULL, `co1` VARCHAR(50), `co2` VARCHAR(50), `co3` V
    Last edited by blackdog; Mar 8, 2005 at 09:39.

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,262
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    TEXT does not take a number in parentheses

    and in the long run you will be much, much happier to remove the first three columns and replace them with a single DATE column

    P.S. could you please edit your message and remove the link to the image on mobilealmanac.com, it scared the pants off me when i first saw it, i thought i had more spyware on my machine
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    boiler up blackdog's Avatar
    Join Date
    Jul 2002
    Location
    Purdue
    Posts
    1,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks! post edited


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •