SQL ( (error #1062) Duplicata du champ '0' pour la clef 'PRIMARY') -
STONEGOLD - 21.07.2015
PHP код:
[23:27:30] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
[23:27:39] [DEBUG] mysql_tquery - connection: 1, query: "INSERT INTO `clothes` (holder, model, bone, offestx, offesty, of", callback: "OnFinishPurchase", format: "id"
[23:27:39] [DEBUG] CMySQLQuery::Execute[OnFinishPurchase] - starting query execution
[23:27:39] [ERROR] CMySQLQuery::Execute[OnFinishPurchase] - (error #1062) Duplicata du champ '0' pour la clef 'PRIMARY'
[23:27:39] [DEBUG] CMySQLQuery::Execute[OnFinishPurchase] - error will be triggered in OnQueryError
Re: SQL ( (error #1062) Duplicata du champ '0' pour la clef 'PRIMARY') -
Beckett - 21.07.2015
Can you show us your
clothes table?
Re: SQL ( (error #1062) Duplicata du champ '0' pour la clef 'PRIMARY') -
STONEGOLD - 21.07.2015
Re: SQL ( (error #1062) Duplicata du champ '0' pour la clef 'PRIMARY') -
DanishHaq - 21.07.2015
Give us the action from the code that corresponds to that query.
Re: SQL ( (error #1062) Duplicata du champ '0' pour la clef 'PRIMARY') -
STONEGOLD - 21.07.2015
PHP код:
stock OnBuyClothes(playerid, index, model, bone, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ)
{
format(query, sizeof(query), "INSERT INTO `clothes` (holder, model, bone, offestx, offesty, offestz, rotx, roty, rotz, scalex, scaley, scalez) VALUES ('%s', %d, %d, %f, %f, %f, %f, %f, %f, %f, %f, %f)",
GetName(playerid), model, bone, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ);
mysql_function_query(1, query, true, "OnFinishPurchase", "id", playerid, index);
}
forward OnFinishPurchase(playerid, index);
public OnFinishPurchase(playerid, index)
{
ClothesInfo[playerid][index][cID] = cache_insert_id(1);
return 1;
}
This?
AW: SQL ( (error #1062) Duplicata du champ '0' pour la clef 'PRIMARY') -
Macronix - 21.07.2015
Is "id" set to AUTO_INCREMENT?
Re: SQL ( (error #1062) Duplicata du champ '0' pour la clef 'PRIMARY') -
STONEGOLD - 21.07.2015
how can i set it as AUTO_INCREMENT? i can't find it.
AW: SQL ( (error #1062) Duplicata du champ '0' pour la clef 'PRIMARY') -
Macronix - 21.07.2015
You need to go on "Change" under "Structure" (row "id") and tick the "A_I" box.
Re: SQL ( (error #1062) Duplicata du champ '0' pour la clef 'PRIMARY') -
StuartD - 21.07.2015
>
Do that.
Re: SQL ( (error #1062) Duplicata du champ '0' pour la clef 'PRIMARY') -
STONEGOLD - 21.07.2015
Anyways, its fixed thanks guyz.