Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2002
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Running SQL query, but errors...

    I run the following SQL query in PHPMyAdmin:

    Code:
    CREATE TABLE message (
      id int(11) NOT NULL auto_increment,
      read char(3) NOT NULL default '',
      show char(3) NOT NULL default '',  
    from varchar(50) NOT NULL default '',
      to varchar(50) NOT NULL default '',
      subject varchar(50) NOT NULL default '',
      msg tinytext NOT NULL,
      time timestamp(14) NOT NULL,
      readconfirm char(3) NOT NULL default '',
      sr char(1) NOT NULL default '',
      linkid varchar(32) NOT NULL default '',
      PRIMARY KEY  (id),
      UNIQUE KEY id (id),
      KEY id_2 (id)
    ) TYPE=MyISAM;
    This is what I get back: You have an error in your SQL syntax near 'read char(3) NOT NULL default '', SHOW char(3) NOT NULL default '', FROM varchar' at line 1


  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,273
    Thanks
    4
    Thanked 83 Times in 82 Posts
    You have at least 3 columns names that are reserved words in MySQL.

    http://www.mysql.com/doc/en/Reserved_words.html
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •