Results 1 to 2 of 2

Thread: help with phpmyadmin making an sql

  1. #1
    Join Date
    Mar 2011
    Posts
    2,144
    Thanks
    59
    Thanked 116 Times in 113 Posts
    Blog Entries
    4

    Post help with phpmyadmin making an sql

    Hi everyone,
    I'm trying to make a new database using phpmyadmin and the sql query window.
    CREATE TABLE tblUsers (
    fldId INT NOT NULL AUTO_INCREMENT,
    fldUsername VARCHAR(40) NOT NULL,
    fldPassword VARCHAR(40) NOT NULL
    );

    does anyone know why this code won't work.
    Thanks for any help

  2. #2
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    phpmyadmin gives this error:
    #1075 - Incorrect table definition; there can be only one auto column and it must be defined as a key
    so, add the key to your auto-increment column:
    Code:
    CREATE TABLE tblUsers (
    fldId INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
    fldUsername VARCHAR(40) NOT NULL,
    fldPassword VARCHAR(40) NOT NULL
    );

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
  •