WeBid icon indicating copy to clipboard operation
WeBid copied to clipboard

issue with column groups in table users

Open hungryfrankie opened this issue 4 years ago • 1 comments

when. a new user registers the data is not entered in the db the reason is the field named groups. sql breaks because it is a reserved word. I had to change the name of this field mysql 8.0.25 php 7.3.24

hungryfrankie avatar Jun 19 '21 06:06 hungryfrankie

the solution is to put it in backtick

I changed the querry to this

 $query = "INSERT INTO " . $DBPrefix . "users
                          (nick, password, hash, name, address, city, prov, country, zip, phone, nletter, email, birthdate,
                          suspended, language, balance, timezone,`groups`)
                          VALUES
                          (:nick, :password, :hash, :name, :address, :city, :prov, :country, :zip, :phone, :nletter, :email, :birthdate,
                          :suspended, :language,  :balance, :timezone,:groups)";
  `

hungryfrankie avatar Jun 19 '21 09:06 hungryfrankie