public bool InsertGuildShare(string RoleName, int RoleID, double Share, int GuildID, int Rank, int FamilyID, string FamilyName)
{
MySQLConnection conn = null;
try
{
conn = this._Database.DBConns.PopDBConnection();
string cmdText = "Insert into t_guildshare(RoleID,Share,GuildID,RoleName,Rank,FamilyID,FamilyName) VALUES (" + RoleID + "," + Share + "," + GuildID + ",`" + RoleName + "`," + Rank + "," + FamilyID + ",`" + FamilyName + "`)";
MySQLCommand cmd = new MySQLCommand(cmdText, conn);
cmd.ExecuteNonQuery();
GameDBManager.SystemServerSQLEvents.AddEvent(string.Format("+SQL: {0}", cmdText), EventLevels.Important);
cmd.Dispose();
cmd = null;
return true;
}
catch (Exception ex)
{
LogManager.WriteLog(LogTypes.Guild, "BUG :" + ex.ToString());
return false;
}
finally
{
if (null != conn)
{
this._Database.DBConns.PushDBConnection(conn);
}
}
}
error message folder
2024-05-06 00:00:01 BUG :MySQLDriverCS.MySQLException (0x80004005): MySQLDriverCS Exception: MySQLDriverCS Error: wrong query.You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘Rank,FamilyID,FamilyName) VALUES (202591,2.58,100035,A_The_LamSao
,10,2,NoMerc' at line 1 Insert into t_guildshare(RoleID,Share,GuildID,RoleName,Rank,FamilyID,FamilyName) VALUES (202591,2.58,100035,
A_The_LamSao,10,2,
NoMercy`)
at MySQLDriverCS.DirectStatement.ExecuteNonQuery()
at GameDBServer.Logic.GuildLogic.GuildManager.InsertGuildShare(String RoleName, Int32 RoleID, Double Share, Int32 GuildID, Int32 Rank, Int32 FamilyID, String FamilyName) in C:UsersADMINDesktopKTSeverFileServer-khacs1GameDBServerGameDBServerLogicGuildLogicGuildManager.cs:line 621
Thanks a lot
Duy Đen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.