SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Addict thoresson's Avatar
    Join Date
    Dec 2002
    Location
    Gothenburg, Sweden
    Posts
    255
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    table creation problem

    Hi,

    I've three tables that my local MySQL server accepts, but when I try to create the same three tables on my ISP's
    server, it doesn't work.

    These are the three tables:

    CREATE TABLE un_user
    (
    u_id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
    u_uname VARCHAR(20) NOT NULL UNIQUE,
    u_pwd CHAR(20) NOT NULL,
    u_fname VARCHAR(20) NOT NULL,
    u_lname VARCHAR(35) NOT NULL,
    u_email VARCHAR(50) NOT NULL,
    u_phone VARCHAR(25) NOT NULL,
    u_cellphone VARCHAR(25) NOT NULL,
    u_editor ENUM("Y","N") DEFAULT "N" NOT NULL,
    u_admin ENUM("Y","N") DEFAULT "N" NOT NULL
    );

    CREATE TABLE un_section
    (
    s_id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
    s_name VARCHAR(40) NOT NULL UNIQUE,
    s_desc TEXT NOT NULL
    );

    CREATE TABLE un_issue
    (
    i_id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
    i_date DATE NOT NULL UNIQUE,
    i_number INT NOT NULL,
    i_editor INT,
    UNIQUE (i_date, i_number)
    );

    For local development I'm using MySQL 3.23.55-NT on a Windows 2000 server. My ISP uses 3.22.25 on a SunOS 5.7
    server.

    Any suggestions?

  2. #2
    SitePoint Wizard
    Join Date
    Mar 2002
    Location
    Bristol, UK
    Posts
    2,240
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you getting any errors?

    -Sam
    Sam Hastings

  3. #3
    SitePoint Addict thoresson's Avatar
    Join Date
    Dec 2002
    Location
    Gothenburg, Sweden
    Posts
    255
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Devilware.net
    Are you getting any errors?
    Sorry. ERROR 1064 at line 1. For all three.

  4. #4
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Shouldn't UNIQUE actually be UNIQUE ID ?

  5. #5
    SitePoint Addict thoresson's Avatar
    Join Date
    Dec 2002
    Location
    Gothenburg, Sweden
    Posts
    255
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dr Livingston
    Shouldn't UNIQUE actually be UNIQUE ID ?
    The problem was that in version 3.22.25 UNIQUE had to be specified at a line of it's own. Like this:

    u_uname VARCHAR(20) NOT NULL,
    UNIQUE (u_uname),

    //Anders


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
  •