-2

I created the following table:

CREATE TABLE contactos (
  id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
  nombre VARCHAR(60), 
  email VARCHAR(60), 
  password VARCHAR(60), 
  fecha TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  KEY(id)
) ENGINE=INNODB DEFAULT CHARSET=utf8;

But when I try to insert values into the table I get error #1064:

INSERT INTO contactos('ID', 'nombre', 'email', 'password', 'fecha') VALUES (NULL, 'Armando', 'armando_zax@hotmail.com', 'hola', NOW() );

I have researched a lot, but couldn´t get what am I doing wrong.

  • 2
    Also: [When to use single quotes, double quotes, and back ticks in MySQL](https://stackoverflow.com/q/11321491/1941241) – rickdenhaan Nov 21 '18 at 19:22

1 Answers1

0

Becouse you are use a wrong quotes "INSERT INTO contactos(`ID`, `nombre`, `email`, `password`, `fecha`) VALUES ..." When you are mean a field name - then you should use ` quote. When a string constant - use ' quote.