Mysql reserved keywords

Asked

Viewed 655 times

0

When I enter php my admin it displays the following message

The column name 'default' is a Mysql reserved keyword.

inserir a descrição da imagem aqui

referring to a field called default of my table

my question is: this can bring some disorder at the time of registration and use of this field?

  • You’re not having a problem anymore :P ?

  • @rray the message appeared only as warning, I have not performed any Insert so far.. is that the Insert is made by a Trigger, so I want to make sure it won’t give problems before testing

  • Change the name of the field that’s better, you can escape it with backsticks but I don’t think it practical.

  • It is not part of good practice to use reserved words, in the way of doubts, changing the name of the column will give you less headache than a possible problem that this may cause in the future.

  • @Edsonhoraciojunior changed to is_default

2 answers

2

It’s not good practice, but I think the only major inconvenience you’re going to have is having to wear mufflers, like "default" or between backticks -> `

2

Words like default, order, name, among others, are reserved.

It is allowed to use but it is necessary to escape with backsticks

 `default`

Browser other questions tagged

You are not signed in. Login or sign up in order to post.