reason:Error Code: 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 'почта VARCHAR(50), тип травмы ENUM('физическая', 'э' at line 9
where did I go wrong?
-
1Schema Object Names - study carefully. Especially the part about quoting.Akina– Akina2024年07月02日 07:59:44 +00:00Commented Jul 2, 2024 at 7:59
1 Answer 1
Column name тип травмы
has a blank (space) in it. That is not allowed. The most common solution is to replace the space by an underscore, like this:
тип_травмы
Another option is to use a quoted identifier:
"тип травмы"
but that makes your code more complicated as it requires each reference to the column to also use quotes. Using underscores is IMO a much simpler solution.
-
2In MySQL this needs in ANSI_QUOTES server SQL mode. Otherwise the value will be treated as string literal which is a syntax error too.Akina– Akina2024年07月02日 08:00:14 +00:00Commented Jul 2, 2024 at 8:00
-
Or use backtics (
`
) around identificers.Rick James– Rick James2024年07月07日 14:19:08 +00:00Commented Jul 7, 2024 at 14:19