A
A
Andrew Electis2018-03-05 07:32:44
MySQL
Andrew Electis, 2018-03-05 07:32:44

Why does an error occur when creating a table?

tell me what's wrong?
CREATE TABLE pass_old ( 'userid' INT(11) NOT NULL AUTO_INCREMENT, 'pass_old' varchar(256), FOREIGN KEY ('userid') REFERENCES users('userid') on delete cascade);
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 ''userid' INT(11) NOT NULL AUTO_INCREMENT, 'pass_old' varchar(256), FOREIGN KEY (' at line 1

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2018-03-05
@electis

Because straight quotes (') denote a string, backticks (`) are used to denote table and field names.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question