SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    What's HTML?
    Join Date
    May 2001
    Location
    San Diego, CA
    Posts
    1,701
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    phpMyAdmin creating bad syntax?

    I'm sure I did something wrong here, but have any of you ever had problems with phpMyAdmin creating bad SQL syntax? I tried creating a table and this error came back to me:
    MySQL said: You have an error in your SQL syntax near 'not null , date DATE not null , PRIMARY KEY (ID), INDEX (ID, wallpaperID), UNI' at line 1

    Here's my table creation code:
    CREATE TABLE wallpaper (ID TINYINT UNSIGNED not null AUTO_INCREMENT, wallpaperID MEDIUMINT UNSIGNED not null , title TEXT not null , description TEXT not null , keywords TEXT not null , views INT UNSIGNED DEFAULT '0' not null , status ENUM not null , date DATE not null , PRIMARY KEY (ID), INDEX (ID, wallpaperID), UNIQUE (ID, wallpaperID))

    Is my ENUM causing the problem? Maybe because I didn't define the enumerated values? By the way, in which field using phpMyAdmin do I define the enumerated values?
    Ryan Kuhle - A Proud Advisor - Got Questions? Just Ask!
    Get your website started for less than $20! Click Here

  2. #2
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes--it's definitely your ENUM that's causing the problems. Haven't worked with phpMyAdmin at all, but ENUM is supposed to look like this:

    ENUM('val1', 'val2', 'valn')

  3. #3
    What's HTML?
    Join Date
    May 2001
    Location
    San Diego, CA
    Posts
    1,701
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Great, that did it, thanks for the pointer Quinn.
    Ryan Kuhle - A Proud Advisor - Got Questions? Just Ask!
    Get your website started for less than $20! Click Here


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
  •