Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

A simple SQL error

  • 11-03-2004 10:53PM
    #1
    Closed Accounts Posts: 414 ✭✭


    Ok trying to create this table for a signup form in php. Keep getting this error messages, anyone tell me what going on?

    SQL-query :

    CREATE TABLE `users` (

    `user_id` INT( 12 ) DEFAULT '0' NOT NULL AUTO_INCREMENT ,
    `username` VARCHAR( 50 ) NOT NULL ,
    `password` VARCHAR( 50 ) NOT NULL ,
    `f_name` VARCHAR( 50 ) NOT NULL ,
    `l_name` VARCHAR( 50 ) NOT NULL ,
    `email ` VARCHAR( 92 ) NOT NULL ,
    `gender` VARCHAR( 40 ) NOT NULL ,
    `birthday` DATE( 40 ) NOT NULL ,
    `region` VARCHAR( 60 ) NOT NULL ,
    `find` VARCHAR( 80 ) NOT NULL ,
    `zip` VARCHAR( 40 ) NOT NULL ,
    `country` VARCHAR( 50 ) NOT NULL ,
    `check` VARCHAR( 50 ) NOT NULL ,
    PRIMARY KEY ( `user_id` )
    )

    MySQL said:


    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 '(40) NOT NULL, `region` VARCHAR(60) NOT NULL, `find` VARCHAR(80


Comments

  • Registered Users, Registered Users 2 Posts: 102 ✭✭OmeGar


    the only thing that jumps out is that you are using the Date Datastructure, are you sure you are putting in the right number of varibles?

    it's all i can see.....maybe i should leave it someone who knows SQL


  • Closed Accounts Posts: 414 ✭✭Divine


    ok OmeGar i just checked up dates there, yeah i should have had them not set at anything. Cheers for that.!!


Advertisement