Open AdmiralGT opened 7 years ago
First stage is database design. Something as simple as this might do:
Player table (index, initials/name, rating, record, profile?) Results table (index, winning player index, losing player index, date/time stamp)
Depends on what new features we want to support. E.g. this design means past record needs to be calculated each time (rather than being stored), though that's a fairly simple DB lookup, so probably doesn't matter.
Maybe record can be calculated each time? That doesn't scale though...
The server should do all the heavy lifting and write to database, rather than all the stuff we have in the client (js) at the moment. Maybe some kind of Ajax callback interface between server and client. http://www.w3schools.com/jquery/jquery_ajax_intro.asp could be useful.
In fact, w3schools is awesome for learning about all things web-y. e.g. SQL stuff http://www.w3schools.com/sql/default.asp
A massive text string is not a database. Let's move to something more appropriate.