Skip to content

Commit b85c9e3

Browse files
committed
Database: Added Helper for get scriptnames of spell
1 parent 9de1e46 commit b85c9e3

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

SpellWork/Database/MySQLConnect.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Collections;
23
using System.Collections.Generic;
34
using System.Windows.Forms;
45
using MySql.Data.MySqlClient;
@@ -38,6 +39,27 @@ private static string GetSpellName(uint id)
3839
return string.Empty;
3940
}
4041

42+
public static ArrayList GetScriptNames(uint id)
43+
{
44+
ArrayList scripts = new ArrayList();
45+
string query = $"SELECT * FROM `spell_script_names` where `spell_id` = {id};";
46+
using (_conn = new MySql.Data.MySqlClient.MySqlConnection(ConnectionString))
47+
{
48+
_command = new MySqlCommand(query, _conn);
49+
_conn.Open();
50+
51+
using (var reader = _command.ExecuteReader())
52+
{
53+
while (reader.Read())
54+
{
55+
var scriptName = reader.GetString(1);
56+
scripts.Add(scriptName);
57+
}
58+
}
59+
}
60+
return scripts;
61+
}
62+
4163
public static void SelectProc(string query)
4264
{
4365
using (_conn = new MySql.Data.MySqlClient.MySqlConnection(ConnectionString))

0 commit comments

Comments
 (0)