|
You last visited: Today at 06:16
Advertisement
Weird Database problem
Discussion on Weird Database problem within the CO2 Private Server forum part of the Conquer Online 2 category.
04/01/2013, 13:06
|
#1
|
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
|
Weird Database problem
when i Save the Chi Class Value by Inserting Method i get this Error
Code:
MySql.Data.MySqlClient.MySqlException (0x80004005): 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 '8,value 9,value 10,value 11) VALUES ('ShallWeDance',1,0,0,0,0)' at line 1
what iam doing wrong to get it ?
regards
shadowman123
|
|
|
04/01/2013, 15:52
|
#2
|
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 950
|
Post your sql query since that's what's causing it.
|
|
|
04/01/2013, 16:29
|
#3
|
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
|
Saving Void
PHP Code:
public static void Save(Client.GameState client, byte GroupNumber)
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
cmd.Insert("chitable").Insert("Name", client.Entity.Name).Insert("LearnedClasses", GroupNumber++)
.Insert("value " + (GroupNumber * 4), client.Chi.ChiValues[GroupNumber * 4])
.Insert("value " + ((GroupNumber * 4) + 1), client.Chi.ChiValues[(GroupNumber * 4) + 1])
.Insert("value " + ((GroupNumber * 4) + 2), client.Chi.ChiValues[(GroupNumber * 4) + 2])
.Insert("value " + ((GroupNumber * 4) + 3), client.Chi.ChiValues[(GroupNumber * 4) + 3])
.Execute();
}
Query
PHP Code:
-- ----------------------------
-- Table structure for `chitable`
-- ----------------------------
DROP TABLE IF EXISTS `chitable`;
CREATE TABLE `chitable` (
`Name` varchar(80) CHARACTER SET utf8 NOT NULL,
`LearnedClasses` mediumint(80) NOT NULL DEFAULT '0',
`Value 0` bigint(80) NOT NULL DEFAULT '0',
`Value 1` bigint(80) NOT NULL DEFAULT '0',
`Value 2` bigint(80) NOT NULL DEFAULT '0',
`Value 3` bigint(80) NOT NULL DEFAULT '0',
`Value 4` bigint(80) NOT NULL DEFAULT '0',
`Value 5` bigint(80) NOT NULL DEFAULT '0',
`Value 6` bigint(80) NOT NULL DEFAULT '0',
`Value 7` bigint(80) NOT NULL DEFAULT '0',
`Value 8` bigint(80) NOT NULL DEFAULT '0',
`Value 9` bigint(80) NOT NULL DEFAULT '0',
`Value 10` bigint(80) NOT NULL DEFAULT '0',
`Value 11` bigint(80) NOT NULL DEFAULT '0',
`Value 12` bigint(80) NOT NULL DEFAULT '0',
`Value 13` bigint(80) NOT NULL DEFAULT '0',
`Value 14` bigint(80) NOT NULL DEFAULT '0',
`Value 15` bigint(80) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
|
|
04/01/2013, 16:31
|
#4
|
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
|
Your issue is that the sql wrapper you're using doesn't support spaces in field or table names.
Re-name your tables to not contain a space, re-write the sql wrapper or write your own sql system (or use nhibernate <3)
|
|
|
04/01/2013, 18:58
|
#5
|
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
|
After alot of Trial and Error i Discovered that the Problem was .. the MySQL Command doesnt allow inserting at columns that contain numbers in their name
This can be Closed Now
|
|
|
04/02/2013, 01:18
|
#6
|
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
|
Unless you have an updated version of the wrapper it also has an issue with spaces in column names.
|
|
|
04/02/2013, 01:51
|
#7
|
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
|
Yea .. to be Honest i havent gone Through Database part ... as i dont got alot of time , havent finished learning C# but Am sure that my database wrapper is bad .. and impulse himself told me that using ORM Database is bad as well as Subsonic System .. NHibernate is the best Ever
|
|
|
 |
Similar Threads
|
Weird problem
05/02/2012 - CO2 Private Server - 2 Replies
Well i made Public class Called Lottery Then i add Made public Field of this Lottery Class like that
publi class Lottery
{
public uint WonID;
}
|
Weird Problem...
03/04/2012 - CO2 Private Server - 4 Replies
So long haha :D
I developed some time ago a 5017 base, and on winxp it was working very well...
I've changed my OS to win7 x64, the source runs normal, but when the client get the npcs spawned, the FPS go to 4/6 and the client get a hudge lag :X
Would that be a problem with the client or WTF is that??????? :D
ty in advance :P
|
KD-Bot Weird Problem Plz Help
01/22/2012 - SRO Private Server - 4 Replies
hello i am trying to use the KD-bot for Atomix server.. i got the loader to work but the KDBotLite.exe will not transfer/extract to the folder .
if anyone knows how i can copy or extract the KDBotlite.exe part to the vsro folder please let me know
|
Weird problem
09/29/2011 - CO2 Private Server - 0 Replies
#Closed, Fixed :D.
|
a weird problem
03/23/2009 - Silkroad Online - 4 Replies
ok i have a cyber cafe...
master pc:
vga card: ati radeon xpress 1250
processor: amd athlon 64 x2 dual core processor 4000+
ram: 2 gb
cyber pc's:
vga card: ati radeon hd3200
processor: amd athlon 64 x2 dual core processor 5000+
|
All times are GMT +1. The time now is 06:17.
|
|