0

enter image description here

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?

1
  • 1
    Schema Object Names - study carefully. Especially the part about quoting. Commented Jul 2, 2024 at 7:59

1 Answer 1

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.

2
  • 2
    In MySQL this needs in ANSI_QUOTES server SQL mode. Otherwise the value will be treated as string literal which is a syntax error too. Commented Jul 2, 2024 at 8:00
  • Or use backtics (`) around identificers. Commented Jul 7, 2024 at 14:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.