SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard
    Join Date
    Feb 2007
    Location
    Southern California
    Posts
    1,380
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    #1064 - You have an error in your SQL syntax

    The following, once copied and pasted into phpMyAdmin, gives me the following familiar error message:

    #1064 - 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 '{ id INT NOT NULL AUTO_INCREMENT PRIMARY KEY UNSIGNED, name VARCHAR(50) NOT NU' at line 1

    I don't know what to change to fix it.

    Code:
    CREATE TABLE Addresses {
    id INT NOT NULL AUTO_INCREMENT PRIMARY KEY
    , name VARCHAR(50) NOT NULL
    , address1 VARCHAR(100) NOT NULL
    , address2 VARCHAR(100) NOT NULL
    , city VARCHAR(30) NOT NULL
    , state CHAR(2) NOT NULL
    , zip VARCHAR(10) NOT NULL
    , url VARCHAR(255) NULL
    , email VARCHAR(255) NULL
    , phone VARCHAR(20) NULL
    , details TEXT NULL
    , display CHAR(1) NULL
    , added DATE NOT NULL
    } DEFAULT CHARACTER SET utf8 ENGINE=InnoDB
    Steve Husting

  2. #2
    SitePoint Enthusiast
    Join Date
    Jul 2007
    Location
    San Sebastian, Spain
    Posts
    93
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You need to use () and not {} for you create table statement.

  3. #3
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    change the { and } for ( and )
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  4. #4
    SitePoint Wizard
    Join Date
    Feb 2007
    Location
    Southern California
    Posts
    1,380
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    A little PHP leaked into my MySQL! Thanks!
    Steve Husting


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
  •