aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Data/MySQL/MySQLGenericTableHandler.cs8
1 files changed, 5 insertions, 3 deletions
diff --git a/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs b/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs
index 4dfc324..b2bd5f6 100644
--- a/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs
+++ b/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs
@@ -205,7 +205,8 @@ namespace OpenSim.Data.MySQL
205 foreach (FieldInfo fi in m_Fields.Values) 205 foreach (FieldInfo fi in m_Fields.Values)
206 { 206 {
207 names.Add(fi.Name); 207 names.Add(fi.Name);
208 values.Add(fi.GetValue(row).ToString()); 208 values.Add("?" + fi.Name);
209 cmd.Parameters.AddWithValue(fi.Name, fi.GetValue(row).ToString());
209 } 210 }
210 211
211 if (m_DataField != null) 212 if (m_DataField != null)
@@ -216,11 +217,12 @@ namespace OpenSim.Data.MySQL
216 foreach (KeyValuePair<string, string> kvp in data) 217 foreach (KeyValuePair<string, string> kvp in data)
217 { 218 {
218 names.Add(kvp.Key); 219 names.Add(kvp.Key);
219 values.Add(kvp.Value); 220 values.Add("?" + kvp.Key);
221 cmd.Parameters.AddWithValue("?" + kvp.Key, kvp.Value);
220 } 222 }
221 } 223 }
222 224
223 query = String.Format("replace into {0} (`", m_Realm) + String.Join("`,`", names.ToArray()) + "`) values ('" + String.Join("','", values.ToArray()) + "')"; 225 query = String.Format("replace into {0} (`", m_Realm) + String.Join("`,`", names.ToArray()) + "`) values (" + String.Join(",", values.ToArray()) + ")";
224 226
225 cmd.CommandText = query; 227 cmd.CommandText = query;
226 228