(Coemu V2) What is wrong with that damn command

07/25/2009 01:18 samehvan#1
hello all

anyone have some exp with mysql would have a look and tell me what is wrong with that damn command

Code:
MySqlCommand Cmd = new MySqlCommand("UPDATE `guilds` SET `Wins` = " + TheGuild.Wins + ", `HoldingPole` = " + TheGuild.HoldingPole + ", `Bulletin` = " + TheGuild.GBull + ", `Enemies` = " + AllEnemies + ", `Allies` = " + AllAllies + ", `Fund` = " + TheGuild.GFund + ", `Members` = " + TheGuild.GMems.Count + " WHERE `GuildID` = " + ID, DatabaseConnection.NewConnection());
and here is the error msg

Quote:
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 Enemies=0,Allies=2,Fund=5000,Members=1, where GuildId=1 Line 1
and the same msg appears once be4 when i tried to save the player spouse
07/25/2009 02:31 tribalost#2
WHERE `GuildID` = " + ID + ";", DatabaseConnection.NewConnection());
07/25/2009 03:16 samehvan#3
Quote:
Originally Posted by tribalost View Post
WHERE `GuildID` = " + ID + ";", DatabaseConnection.NewConnection());
no ,that should give a syntax error , and notice that it already does the first part successfully , it saves the wins,holdingpole and Bulletin
07/25/2009 03:38 kinshi88#4
If it's a string your writing to the Sql, you have to add ' ' s around it.

So like:
Code:
`Bulletin` = [B][U]'[/U][/B]" + TheGuild.GBull + "[B][U]'[/U][/B]
07/25/2009 12:48 samehvan#5
Quote:
Originally Posted by kinshi88 View Post
If it's a string your writing to the Sql, you have to add ' ' s around it.

So like:
Code:
`Bulletin` = [B][U]'[/U][/B]" + TheGuild.GBull + "[B][U]'[/U][/B]
#solved thanks for your help
Request close or delete :p
07/25/2009 14:51 tanelipe#6
#Closed as requested.