[Mysql] Error #1136
#1

Hi,

I'm trying to do my house system and I have this to insert into the database, but when it tries to, it doesn't insert the data and I have this Error in mysql_log.

Код:
[13:30:22] [DEBUG] mysql_format - connection: 1, len: 1024, format: "INSERT INTO `maisons` (`Proprietaire`, `Prix`, `Ouverte`,`Achetee`, `Location`, `PrixLocation`, `NombreLocataire`, `Coffre`, `en..."
[13:30:22] [DEBUG] mysql_tquery - connection: 1, query: "INSERT INTO `maisons` (`Proprietaire`, `Prix`, `Ouverte`,`Achete", callback: "(null)", format: "(null)"
[13:30:22] [DEBUG] CMySQLQuery::Execute[] - starting query execution
[13:30:22] [ERROR] CMySQLQuery::Execute[] - (error #1136) Column count doesn't match value count at row 1
So this is what I'm trying to insert:

Код:
		mysql_format(mysql, query, sizeof(query), "INSERT INTO `maisons` (`Proprietaire`, `Prix`, `Ouverte`,`Achetee`, `Location`, `PrixLocation`, `NombreLocataire`, `Coffre`, `entreeX` ,`entreeY`, `entreeZ`, `sortieX`, `sortieY`, `sortieZ`, `Interieur`, `World`, `Arme1`, `Munition1`, `Arme2`, `Munition2`,`Arme3`, `Munition3`) VALUES ('%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%f', '%f', '%f', '%f', '%f', '%f', '%d', '%d',  '%d', '%d', '%d', '%d', '%d', '%d', '%d')", 
		"Ville de Los Santos", mInfo[id][mPrix], mInfo[id][mOuverte], mInfo[id][mAchetee], mInfo[id][mLocation], mInfo[id][mPrixLocation], mInfo[id][mNombreLocataire], mInfo[id][mCoffre], mInfo[id][mEntreeX], mInfo[id][mEntreeY], mInfo[id][mEntreeZ],
		mInfo[id][mSortieX], mInfo[id][mSortieY], mInfo[id][mSortieZ], mInfo[id][mInterieur], mInfo[id][mWorld], mInfo[id][mModele], 0, 0, 0, 0, 0, 0);
		
        mysql_tquery(mysql, query, "", "");
How could I solve this problem please ?

Thank you !
Reply
#2

It looks like your string size is too small. Increase the size of query.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)