diff --git a/server.js b/server.js index 9512e67..35aced1 100644 --- a/server.js +++ b/server.js @@ -58,14 +58,7 @@ app.get('/', function (req, res) { console.log('Serializing'); database.serialize(function() { - database.get("SELECT COUNT(*) FROM players", function (err, row) { - player_number = row; - }); - database.get("SELECT COUNT(*) FROM stats", function (err, row) { - stats_number = row; - }); console.log('Querying players'); - database.each("SELECT * FROM players", function(err, row) { console.log('Received a player row! Weheeeee!'); var nextElement = players.length; @@ -73,6 +66,13 @@ app.get('/', function (req, res) { console.log(players); }); + database.get("SELECT COUNT(*) FROM players", function (err, row) { + player_number = row; + }); + database.get("SELECT COUNT(*) FROM stats", function (err, row) { + stats_number = row; + }); + res.render('index', { title: 'My Game',