Results 1 to 6 of 6

Thread: Login Using Flash MX, PHP, and MySQL: Error MySQL

  1. #1

    Login Using Flash MX, PHP, and MySQL: Error MySQL

    Hi all,

    I've followed this tutorial:
    http://www.kirupa.com/developer/acti...entication.htm

    All setup and trying to add the table in mySQL database, but i get an error.

    I try to add a table using this code from the tutorial:
    Code:
    CREATE TABLE auth (
      userid
        int(4)
        unsigned
        zerofill
        DEFAULT '0000'
        NOT NULL
        auto_increment,
      username varchar(20),
      userpassword varchar(20),
      PRIMARY KEY (userid)
    );
    When i enter it in SQL i get this error:

    Code:
    Error
     
    SQL query: 
     
    CREATE TABLE auth( useridint( 4 ) unsignedzerofillDEFAULT '0000' NOT NULL AUTO_INCREMENT ,
    username varchar( 20 ) ,
    userpassword varchar( 20 ) ,
    PRIMARY KEY ( userid ) 
    ) 
     
    MySQL said:  
    #1067 - Invalid default value for 'userid'
    I'm just a newbie trying to understand all this new stuff, so if a wizz could help me out here (s)he'd make me a very happy man

    Thanks in advance!

    Xs.

  2. #2
    1,839
    posts
    Registered User
    CREATE TABLE auth( userid int( 4 ) unsigned zerofill DEFAULT '0000' NOT NULL AUTO_INCREMENT ,
    username varchar( 20 ) ,
    userpassword varchar( 20 ) ,
    PRIMARY KEY ( userid )
    )

  3. #3
    Quote Originally Posted by joran420 View Post
    CREATE TABLE auth( userid int( 4 ) unsigned zerofill DEFAULT '0000' NOT NULL AUTO_INCREMENT ,
    username varchar( 20 ) ,
    userpassword varchar( 20 ) ,
    PRIMARY KEY ( userid )
    )
    Stil no luck:

    Code:
    SQL query: 
     
    CREATE TABLE auth( userid int( 4 ) unsigned zerofill DEFAULT '0000' NOT NULL AUTO_INCREMENT ,
     
    MySQL said:  
    #1067 - Invalid default value for 'userid'
    Use "," as delimiter right? Because default is ";" and gives the same error as before.

    Details:
    MySQL client version: 5.0.19
    phpMyAdmin - 2.11.2

  4. #4
    Code:
    CREATE TABLE `<dB Name>`.`auth` (
    `userid` INT( 4 ) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT PRIMARY KEY ,
    `username` VARCHAR( 20 ) NOT NULL ,
    `userpassword` VARCHAR( 20 ) NOT NULL 
    ) ENGINE = MYISAM
    I've tried to add them manually. I've never done it before so i might have made some errors ?

    What does MYISAM do / mean?

  5. #5
    yea just get rid of the default value in userid should be fine. MYISAM is just the storage type http://dev.mysql.com/doc/refman/5.0/...ge-engine.html
    Let us live so that when we come to die even the undertaker will be sorry. - Mark Twain
    Don't PM me your CSS, xHTML, JS or PHP questions. I will not reply to ANY IE6 questions.

  6. #6
    if you want to start the autoincrement with some number use:

    CREATE TABLE something (
    ....
    fields here, bla bla
    PRIMARY KEY( bla,blarg)
    ....
    ) TYPE=MyISAM AUTO_INCREMENT=1001;

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012