SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2000
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I tried to create the following table:

    mysql> CREATE TABLE Members (
    -> userid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
    -> email VARCHAR(100) NOT NULL,
    -> password VARCHAR(16) NOT NULL,
    -> name VARCHAR(100) NOT NULL,
    -> country VARCHAR(100) NOT NULL,
    -> update VARCHAR(3) NOT NULL,
    -> joined DATE NOT NULL
    -> );

    But I received this error:

    ERROR 1064: You have an error in your SQL syntax near 'update VARCHAR(3) NOT NUL
    L,
    joined DATE NOT NULL
    )' at line 7

    What am I doing wrong?

  2. #2
    Feel my RewiredMind KMxRetro's Avatar
    Join Date
    Jan 2001
    Location
    Exeter, Devon, UK
    Posts
    477
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi there,
    I'm not altogether sure about this, but I *THINK* that you cannot use NOT NULL on a DATE field.

    Anyone else shed any more light if this doesn't work?

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2000
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I this article by Kevin Yank

    http://www.webmasterbase.com/article.php/228/180

    you can see that he is using the NOT NULL on a DATE field.

  4. #4
    Feel my RewiredMind KMxRetro's Avatar
    Join Date
    Jan 2001
    Location
    Exeter, Devon, UK
    Posts
    477
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I never said I was right I very rarely am!

    Anyways, I'll have a look into it.

  5. #5
    SitePoint Enthusiast
    Join Date
    Jul 2000
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can no one help me? Where are the MySQL experts that visit this board?

  6. #6
    SitePoint Addict mickmel's Avatar
    Join Date
    Feb 2001
    Location
    Marietta, GA
    Posts
    274
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you allowed to use the word "update" for a column name, since it is also the name of a command?

  7. #7
    SitePoint Enthusiast
    Join Date
    Jul 2000
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you allowed to use the word "update" for a column name, since it is also the name of a command?
    Thanks mickmel! I changed the column name "update" to "list" and it worked!


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
  •