SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot blackman890's Avatar
    Join Date
    Feb 2005
    Location
    Iceland
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Creating table not working

    Hi guys, stupid question here:

    why isn't the following working in MySql:

    PHP Code:
    mysqlCREATE TABLE programming (
        -> 
    id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
        -> 
    name TINYTEXT,
        -> 
    desc TEXT,
        -> 
    files INT NOT NULL); 
    I always get the following error:

    PHP Code:
    ERROR 1064 (42000): You have an error in your SQL syntaxcheck the manual that corresponds to your MySQL server version for the right syntax to use near 'desc TEXT,
    files INT NOT NULL)' 
    at line 4 
    Please tell me what is wrong as I cant see it fully
    Jonatan Nilsson
    Iceland
    C# Programmer - XML & DirectX (y = hx + c)

  2. #2
    Free your mind Toly's Avatar
    Join Date
    Sep 2001
    Location
    Panama
    Posts
    2,182
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Because 'desc' is a reserved word in MySQL. Try using a different name like 'description'.
    Community Guidelines | Community FAQ

    "He that is kind is free, though he is a slave;
    he that is evil is a slave, though he be a king." - St. Augustine

  3. #3
    SitePoint Zealot blackman890's Avatar
    Join Date
    Feb 2005
    Location
    Iceland
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks, it is working now
    Jonatan Nilsson
    Iceland
    C# Programmer - XML & DirectX (y = hx + c)


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
  •