Guten Morgen,
Ich habe in meiner MySQL Log diesen Fehler.
[ERROR] CMySQLQuery::Execute[()] - (error #1062) Duplicate entry '0' for key 'PRIMARY'
public OnUserCheck(playerid)
{
new num_rows,num_fields;
cache_get_data(num_rows,num_fields,dbhandle);
if(num_rows==0)
{
ShowPlayerDialog(playerid,DIALOG_REGISTRATION,DIALOG_STYLE_INPUT,"REGISTER","GIB PASSWORT EIN","Fertig","Abbruch");
}
else
{
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid==DIALOG_REGISTRATION)
{
if(response==0)return Kick(playerid);
if(response==1)
{
new query[128],password[35];
mysql_escape_string(inputtext,password,dbhandle);
format(query,sizeof(query),"INSERT INTO usertest(username,passwort) VALUES ('%s','%s')",SpielerName(playerid),password);
mysql_function_query(dbhandle,query,false,"","");
}
}
return 1;
}
Wusste jetzt nicht was ihr braucht, daher mal die beiden.
PS: Lerne von MrMonatHD
MfG.