28.01.2017, 17:02
I've been taking a break from scripting for a year. Last time i checked my gamemode was working 100%..
Now it seems my register it's not working anymore , i don't understand why.
The problem is that cache insert id is not returning anything.
(error #1364) Field 'PlayerID' doesn't have a default value
Did i miss something ? I need to update the MySQL is r39-2 .
Now it seems my register it's not working anymore , i don't understand why.
The problem is that cache insert id is not returning anything.
(error #1364) Field 'PlayerID' doesn't have a default value
pawn Код:
if(strlen(inputtext))
{
new query[1000];
PlayerInfo[playerid][pLanguage] = Language[playerid];
format(PlayerInfo[playerid][pPassword], 256, inputtext);
mysql_format(mysql, query, sizeof(query), "INSERT INTO `accounts` ( `Username`, `Password`, `Language`) VALUES ('%s', '%s', '%d')", GetName(playerid), inputtext, Language[playerid]);
mysql_tquery(mysql, query, "RegisterAccountInfo", "i", playerid);
}
pawn Код:
script RegisterAccountInfo(playerid)
{
PlayerInfo[playerid][pID] = cache_insert_id();
PlayerInfo[playerid][pLevel] = 1;
new strglobal[856];
if(Language[playerid] == EN)
{
format(strglobal,sizeof(strglobal), "{FFFFFF}Question : Your character is male or female ?");
ShowPlayerDialogEx(playerid,DIALOG_SEX,DIALOG_STYLE_MSGBOX,"SERVER: {FFFFFF}GENDER",strglobal,"Male","Female");
}
if(Language[playerid] == RO)
{
format(strglobal,sizeof(strglobal), "{FFFFFF}Оntrebare : Personajul tгu este femeie sau bгrbat ?");
ShowPlayerDialogEx(playerid,DIALOG_SEX,DIALOG_STYLE_MSGBOX,"SERVER: {FFFFFF}GENDER",strglobal,"Bгrbat","Femeie");
}
CC(playerid, 10);
new query[456];
format(query,sizeof(query), "UPDATE accounts SET IsConnected = 1, PlayerID = %d where ID = %d", cache_insert_id(), playerid);
mysql_tquery(mysql, query, "", "");
}