internal void submit_to_db() { MySQLConn myConn = new MySQLConn(); string query = "insert into champ_details values " + get_sql(); var cmd = new MySqlCommand(query, myConn.conn); cmd.ExecuteNonQuery(); myConn.conn.Close(); }
internal void submit_tag_row(string tag) { MySQLConn myConn = new MySQLConn(); string query = "insert into champ_tags values ( " + this.id + ", '" + tag.Replace("'", "") + "' ) "; var cmd = new MySqlCommand(query, myConn.conn); cmd.ExecuteNonQuery(); myConn.conn.Close(); }
private void format_item_numbers() { MySQLConn myConn = new MySQLConn(); string query = "select version_diff_win_percent, total_diff, name, item_id from versions_item_num_diff"; var cmd = new MySqlCommand(query, myConn.conn); var reader = cmd.ExecuteReader(); // {x: {0}, y:{1}, name:'{2}', marker:{ symbol: 'url(http://ddragon.leagueoflegends.com/cdn/5.2.1/img/item/{3})', width: 25, height: 25}} if (reader.Read()) { Console.WriteLine("{{x: {0}, y:{1}, name:'{2}', marker:{{ symbol: 'url(http://ddragon.leagueoflegends.com/cdn/5.2.1/img/item/{3}.png)', width: 25, height: 25}}}} , ", reader.GetDecimal("version_diff_win_percent"), reader.GetInt32("total_diff"), reader.GetString("name").Replace("'", ""), reader.GetInt32("item_id").ToString()); while (reader.Read()) { Console.WriteLine(" {{x: {0}, y:{1}, name:'{2}', marker:{{ symbol: 'url(http://ddragon.leagueoflegends.com/cdn/5.2.1/img/item/{3}.png)', width: 25, height: 25}}}} , ", reader.GetDecimal("version_diff_win_percent"), reader.GetInt32("total_diff"), reader.GetString("name").Replace("'", ""), reader.GetInt32("item_id").ToString()); } } myConn.conn.Close(); }
private void check_match(long match_id) { MySQLConn myConn = new MySQLConn(); string query = "select * from player_stats where match_id = '" + match_id + "'"; var cmd = new MySqlCommand(query, myConn.conn); var reader = cmd.ExecuteReader(); if (!reader.HasRows) { Console.WriteLine(match_id); } myConn.conn.Close(); }
private void send_item_events(Dictionary<int, List<ItemRow>> item_rows_per_player) { foreach (List<ItemRow> list in item_rows_per_player.Values) { MySQLConn myConn = new MySQLConn(); string query = "insert into item_events values "; for (int index = 0; index < list.Count; index++) { var item_event = list[index]; if (index < list.Count - 1) { query += item_event.get_sql() + ","; } else { query += item_event.get_sql() + ";"; } } var cmd = new MySqlCommand(query, myConn.conn); cmd.ExecuteNonQuery(); myConn.conn.Close(); } }
private void send_player_info(Dictionary<int , PlayerRow> player_rows) { MySQLConn myConn = new MySQLConn(); string query = "insert into player_stats values "; for (int index = 0; index < player_rows.Count; index++) { var player_r = player_rows[index]; if (index < player_rows.Count - 1) { string temp = player_r.get_sql() + ","; query += temp; } else { query += player_r.get_sql() + ";"; } } var cmd = new MySqlCommand(query, myConn.conn); cmd.ExecuteNonQuery(); myConn.conn.Close(); }