aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/MySQL/MySQLGenericTableHandler.cs25
1 files changed, 25 insertions, 0 deletions
diff --git a/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs b/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs
index 2f5937d..9b8a001 100644
--- a/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs
+++ b/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs
@@ -195,6 +195,31 @@ namespace OpenSim.Data.MySQL
195 MySqlCommand cmd = new MySqlCommand(); 195 MySqlCommand cmd = new MySqlCommand();
196 196
197 string query = ""; 197 string query = "";
198 List<String> names = new List<String>();
199 List<String> values = new List<String>();
200
201 foreach (FieldInfo fi in m_Fields.Values)
202 {
203 names.Add(fi.Name);
204 values.Add(fi.GetValue(row).ToString());
205 }
206
207 if (m_DataField != null)
208 {
209 Dictionary<string, string> data =
210 (Dictionary<string, string>)m_DataField.GetValue(row);
211
212 foreach (KeyValuePair<string, string> kvp in data)
213 {
214 names.Add(kvp.Key);
215 values.Add(kvp.Value);
216 }
217 }
218
219 query = String.Format("replace into {0} (`", m_Realm) + String.Join("`,`", names.ToArray()) + "`) values ('" + String.Join("','", values.ToArray()) + "')";
220
221 if (ExecuteNonQuery(cmd) > 0)
222 return true;
198 223
199 return false; 224 return false;
200 } 225 }