SA-MP Forums Archive
[Mysql] Error #1136 - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [Mysql] Error #1136 (/showthread.php?tid=499465)



[Mysql] Error #1136 - anou1 - 08.03.2014

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 !


Re: [Mysql] Error #1136 - SuperViper - 08.03.2014

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