SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Evangelist
    Join Date
    Jul 2001
    Location
    UK
    Posts
    407
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    SQL syntax problem

    What's up with this MySQL syntax?

    Code:
    CREATE TABLE users (
    ID int NOT NULL, 
    Alias varchar(40) NOT NULL, 
    Team varchar NOT NULL, 
    FName varchar NOT NULL, 
    SName varchar NOT NULL, 
    DOB date NOT NULL, 
    Gender tinyint(1) NOT NULL, 
    Password varchar NOT NULL, 
    Email varchar NOT NULL, 
    ICQ varchar NULL, 
    MSN varchar NULL, 
    AIM varchar NULL, 
    YIM varchar NULL, 
    Showemail tinyint(1) NOT NULL, 
    ShowIM tinyint(1) NOT NULL, 
    Mobile varchar NULL, 
    CountryID INT NOT NULL, 
    State varchar NOT NULL, 
    Bio varchar NULL, 
    NewPassword varchar NOT NULL, 
    NewEmail varchar NOT NULL, 
    PicID tinyint NOT NULL,
    PRIMARY KEY (ID)
    );
    TIA

  2. #2
    SitePoint Member
    Join Date
    Apr 2001
    Location
    Newcastle, UK
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well, much as my memory as a bit iffy on this (been a while since I had a similar prob) I seem to remember that MySQL wont let you use password as a column name, so try changing it to something like pass or passwd and see if that goes. It doenst seem to be documented as a reserved word but it normally acts as one.

  3. #3
    Database Jedi MattR's Avatar
    Join Date
    Jan 2001
    Location
    buried in the database shell (Washington, DC)
    Posts
    1,107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    All character datatypes besides text require a size parameter.

    e.g.
    VARCHAR( 40 )
    CHAR( 10 )

  4. #4
    SitePoint Evangelist
    Join Date
    Jul 2001
    Location
    UK
    Posts
    407
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, it works now.


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
  •