Weird Database problem

04/01/2013 13:06 shadowman123#1
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 Super Aids#2
Post your sql query since that's what's causing it.
04/01/2013 16:29 shadowman123#3
Saving Void
PHP Code:
public static void Save(Client.GameState clientbyte 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` (
  `
Namevarchar(80CHARACTER SET utf8 NOT NULL,
  `
LearnedClassesmediumint(80NOT NULL DEFAULT '0',
  `
Value 0bigint(80NOT NULL DEFAULT '0',
  `
Value 1bigint(80NOT NULL DEFAULT '0',
  `
Value 2bigint(80NOT NULL DEFAULT '0',
  `
Value 3bigint(80NOT NULL DEFAULT '0',
  `
Value 4bigint(80NOT NULL DEFAULT '0',
  `
Value 5bigint(80NOT NULL DEFAULT '0',
  `
Value 6bigint(80NOT NULL DEFAULT '0',
  `
Value 7bigint(80NOT NULL DEFAULT '0',
  `
Value 8bigint(80NOT NULL DEFAULT '0',
  `
Value 9bigint(80NOT NULL DEFAULT '0',
  `
Value 10bigint(80NOT NULL DEFAULT '0',
  `
Value 11bigint(80NOT NULL DEFAULT '0',
  `
Value 12bigint(80NOT NULL DEFAULT '0',
  `
Value 13bigint(80NOT NULL DEFAULT '0',
  `
Value 14bigint(80NOT NULL DEFAULT '0',
  `
Value 15bigint(80NOT NULL DEFAULT '0'
ENGINE=InnoDB DEFAULT CHARSET=latin1
04/01/2013 16:31 pro4never#4
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 shadowman123#5
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 pro4never#6
Unless you have an updated version of the wrapper it also has an issue with spaces in column names.
04/02/2013 01:51 shadowman123#7
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