renlok / WeBid

The official WeBid github fork
http://www.webidsupport.com
114 stars 125 forks source link

issue with column groups in table users #536

Open hungryfrankie opened 3 years ago

hungryfrankie commented 3 years ago

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 commented 3 years ago

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)";
  `