public Database(Player p)
        {
            MySqlConnectionStringBuilder connBuilder = new MySqlConnectionStringBuilder();

            connBuilder.Server   = "localhost";
            connBuilder.Database = "mydb";
            connBuilder.UserID   = "root";
            connBuilder.Password = "******";
            connection           = new MySqlConnection(connBuilder.ToString());

            bool name_exist = nameCheck(connection, p);

            if (name_exist)
            {
                try
                {
                    MySqlCommand cmd = new MySqlCommand();
                    cmd.Connection  = connection;
                    cmd.CommandText = "UPDATE statictics SET Wins=@Wins, Losses=@Losses ,HighScore=@HighScore WHERE Name = @Name;";
                    //cmd.Parameters.Clear();
                    cmd.Parameters.AddWithValue("@Name", p.getPlayerName());
                    cmd.Parameters.AddWithValue("@Wins", p.getWins());
                    cmd.Parameters.AddWithValue("@Losses", p.getLosses());
                    cmd.Parameters.AddWithValue("@HighScore", p.getHighScore());
                    cmd.ExecuteNonQuery();
                }
                catch (Exception)
                {
                    log.Error("Error occured while updating database");
                    throw;
                }
            }
            else
            {
                try
                {
                    MySqlCommand cmd = connection.CreateCommand();
                    cmd.CommandText = "INSERT INTO statictics (Name,Wins,Losses,HighScore)VALUES(@Name,@Wins,@Losses,@HighScore)";
                    cmd.Parameters.AddWithValue("@Name", p.getPlayerName());
                    cmd.Parameters.AddWithValue("@Wins", p.getWins());
                    cmd.Parameters.AddWithValue("@Losses", p.getLosses());
                    cmd.Parameters.AddWithValue("@HighScore", p.getHighScore());
                    cmd.ExecuteNonQuery();
                }

                catch (Exception)
                {
                    log.Error("Error occured while inserting data to a database");
                    throw;
                }
            }

            /*using (connection)
             * {
             *  string s = "mydb.statictics;";
             *  MySqlDataAdapter adapter = new MySqlDataAdapter("select * from " + s, connection);
             *
             *  adapter.Fill(ds, s);
             *
             * }*/
        }