Merge branch 'master' into presence-refactor

slimupdates
Melanie 2009-12-27 01:28:15 +00:00
commit ca3aa283ba
1 changed files with 5 additions and 3 deletions

View File

@ -205,7 +205,8 @@ namespace OpenSim.Data.MySQL
foreach (FieldInfo fi in m_Fields.Values) foreach (FieldInfo fi in m_Fields.Values)
{ {
names.Add(fi.Name); names.Add(fi.Name);
values.Add(fi.GetValue(row).ToString()); values.Add("?" + fi.Name);
cmd.Parameters.AddWithValue(fi.Name, fi.GetValue(row).ToString());
} }
if (m_DataField != null) if (m_DataField != null)
@ -216,11 +217,12 @@ namespace OpenSim.Data.MySQL
foreach (KeyValuePair<string, string> kvp in data) foreach (KeyValuePair<string, string> kvp in data)
{ {
names.Add(kvp.Key); names.Add(kvp.Key);
values.Add(kvp.Value); values.Add("?" + kvp.Key);
cmd.Parameters.AddWithValue("?" + kvp.Key, kvp.Value);
} }
} }
query = String.Format("replace into {0} (`", m_Realm) + String.Join("`,`", names.ToArray()) + "`) values ('" + String.Join("','", values.ToArray()) + "')"; query = String.Format("replace into {0} (`", m_Realm) + String.Join("`,`", names.ToArray()) + "`) values (" + String.Join(",", values.ToArray()) + ")";
cmd.CommandText = query; cmd.CommandText = query;