Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2003
    san jose, CA

    Unanswered: create table command syntax error

    Hello everyone:

    I want to create a table in DOS command line prompt.

    I received a syntax error message but I couln't figure out what caused the error.

    Could somone take look at my 'create table' syntax and tell me what I did wrong? I appreciate your help!
    PHP Code:
      create table computers(
    emp_id int unsigned not null auto_increment,
    pc_name varchar(50not null,
    current_user varchar(50not null,
    act_key varchar(50),
    ms_office_key varchar(50),
    norton_order_num varchar(50),
    serial_num varchar(50),
    make varchar(50not null,
    model varchar(50not null,
    OS varchar(50not null,
    purchase_date datetime not null,
    in_use varchar(1not null,
    location varchar(50not null,
    product_num varchar(50not null,
    os_key varchar(50not null,
    primary key (emp_id)); 
    ---------- Error Message --------------------------
    ERROR 1064 (42000): 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 'current_user varchar(50) not null,
    act_key varchar(50),
    ms_office_key varchar(' at line 4


  2. #2
    Join Date
    Mar 2007
    I have a feeling "current_user" might be a reserved word. Try putting the column names in backticks (`),

    create table computers(
      emp_id int unsigned not null auto_increment,
      pc_name varchar(50) not null,
      `current_user` varchar(50) not null,
      act_key varchar(50),
      ms_office_key varchar(50),
      norton_order_num varchar(50),
      serial_num varchar(50),
      make varchar(50) not null,
      model varchar(50) not null,
      OS varchar(50) not null,
      purchase_date datetime not null,
      in_use varchar(1) not null,
      location varchar(50) not null,
      product_num varchar(50) not null,
      os_key varchar(50) not null,
      primary key (emp_id)

  3. #3
    Join Date
    Nov 2003
    Provided Answers: 8
    Quote Originally Posted by aschk
    I have a feeling "current_user" might be a reserved word. Try putting the column names in backticks (`)
    I would highly recommend not using a reserved word at all, it just creates too many problems.

Posting Permissions

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