SQL ( (error #1062) Duplicata du champ '0' pour la clef 'PRIMARY')
#1

PHP код:
[23:27:30] [DEBUGCMySQLResult::~CMySQLResult() - deconstructor called
[23:27:39] [DEBUGmysql_tquery connection1query"INSERT INTO `clothes` (holder, model, bone, offestx, offesty, of"callback"OnFinishPurchase"format"id"
[23:27:39] [DEBUGCMySQLQuery::Execute[OnFinishPurchase] - starting query execution
[23:27:39] [ERRORCMySQLQuery::Execute[OnFinishPurchase] - (error #1062) Duplicata du champ '0' pour la clef 'PRIMARY'
[23:27:39] [DEBUGCMySQLQuery::Execute[OnFinishPurchase] - error will be triggered in OnQueryError 
Reply
#2

Can you show us your clothes table?
Reply
#3


Reply
#4

Give us the action from the code that corresponds to that query.
Reply
#5

PHP код:
stock OnBuyClothes(playeridindexmodelboneFloat:fOffsetXFloat:fOffsetYFloat:fOffsetZFloat:fRotXFloat:fRotYFloat:fRotZFloat:fScaleXFloat:fScaleYFloat:fScaleZ)
{
    
format(querysizeof(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), modelbonefOffsetXfOffsetYfOffsetZfRotXfRotYfRotZfScaleXfScaleYfScaleZ);
    
mysql_function_query(1querytrue"OnFinishPurchase""id"playeridindex);
}
forward OnFinishPurchase(playeridindex);
public 
OnFinishPurchase(playeridindex)
{
    
ClothesInfo[playerid][index][cID] = cache_insert_id(1);
    return 
1;

This?
Reply
#6

Is "id" set to AUTO_INCREMENT?
Reply
#7

how can i set it as AUTO_INCREMENT? i can't find it.
Reply
#8

You need to go on "Change" under "Structure" (row "id") and tick the "A_I" box.
Reply
#9

>

Do that.
Reply
#10

Anyways, its fixed thanks guyz.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)