03.05.2014, 22:13
I have this error with code:
pawn Код:
[21:52:11] CMySQLHandler::Query(INSERT INTO srp_players_weed SET ID=1, VW=0, Inte=0, planteur='Rislo_Blunt', PosX=1743.667480, PosY=-1857.371704, PosZ=13.414062, Variete=1, Temps=0, Grammes=0) - An error has occured. (Error ID: 1062, Duplicate entry '1' for key 'PRIMARY')
pawn Код:
if(listitem == 0)
{
new sql[512], result[512], stringvariete[10];
new Interieur = GetPlayerInterior(playerid);
new VirtualWorld = GetPlayerVirtualWorld(playerid);
new idzeub = IDExistantWeed();
new Float:POX, Float:POY, Float:POZ;
GetPlayerPos(playerid, POX, POY, POZ);
if(WeedInfo[idzeub][Variete] == 1) format(stringvariete, sizeof(stringvariete), "Amnйsia");
WeedInfo[idzeub][ID] = idzeub;
WeedInfo[idzeub][VW] = VirtualWorld;
WeedInfo[idzeub][Inte] = Interieur;
strmid(WeedInfo[idzeub][Planteur], pName[playerid], 0, strlen(pName[playerid]), 255);
WeedInfo[idzeub][PosX] = POX;
WeedInfo[idzeub][PosY] = POY;
WeedInfo[idzeub][PosZ] = POZ;
WeedInfo[idzeub][Variete] = 1;
WeedInfo[idzeub][Temps] = 0;
WeedInfo[idzeub][Grammes] = 0;
// objet + label
format(sql, sizeof(sql), "SELECT COUNT(*) FROM srp_players_weed");
MySQLCheckConnection();
mysql_query(sql);
mysql_store_result();
mysql_fetch_row(result);
mysql_free_result();
format(sql, sizeof(sql), "INSERT INTO srp_players_weed SET ID=%d, VW=%d, Inte=%d, planteur='%s', PosX=%f, PosY=%f, PosZ=%f, Variete=%d, Temps=0, Grammes=0", idzeub, VirtualWorld, Interieur, pName[playerid], POX, POY, POZ, WeedInfo[idzeub][Variete]);
MySQLCheckConnection();
mysql_query(sql);
}