rubenvanassche / Programming-Project-Databases

A World championship statistics website
coachcenter.be
GNU General Public License v3.0
1 stars 1 forks source link

Change country to country_id in user table? #62

Closed JakobStruye closed 10 years ago

JakobStruye commented 10 years ago

Is anyone against changing the country field in the user table to a country_id? It takes up a little less memory, and seeing as registration now uses a dropdown menu with all the countries in the database, it's super easy to adapt the code to this.

rubenvanassche commented 10 years ago

Do it, but also provide a function to change the ID back in a string which can be used on the profile page(I'm working on it right now so just provide the function and i do the rest).

JakobStruye commented 10 years ago

country has been changed to country_id and a Country::getName($id) has been provided. Note that it will return an empty string for a non-existent id.

As a sidenote, I noticed you (?) mistyped UserGroup as Usergroup in UserController causing the profile and others to crash. I didn't change it myself to avoid any conflicts.

rubenvanassche commented 10 years ago

What is crashing? Because nothing is crashing over here.

JakobStruye commented 10 years ago

Line 376 in UserController is "$usergroup = new Usergroup;" while the class for user groups is called UserGroup. It causes My Profile to crash on load.

rubenvanassche commented 10 years ago

Strange: have the same line but my profile doesn't crash.

JakobStruye commented 10 years ago

Apparently your interpreter is case-insensitive for class names while mine isn't. Shall I change it then?

rubenvanassche commented 10 years ago

No, at the moment I am working on that page so I shall change it .