05.08.2015, 22:29
I'm having 100 players + online on server, the problem is i'm getting this errors constantly:
- Log("01:24:59","CMySQLQuery::Execute[]",1,"(error #1062) Duplicate entry '90' for key 'PRIMARY'",1);
Log("01:25:12","CMySQLQuery::Execute[]",1,"(error #1062) Duplicate entry '91' for key 'PRIMARY'",1);
Log("01:31:23","CMySQLQuery::Execute[]",1,"(error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '''' WHERE id = 431' at line 1",1);
Log("01:33:09","CMySQLQuery::Execute[]",1,"(error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''' at line 1",1);
From register , and loading i'm getting 'unkown where clause ' * player name * '
the functions i'm using is
//Login
mysql, query, sizeof(query), "SELECT * FROM `players` WHERE `Name` = '%e' LIMIT 1", GetName(playerid));
mysql_tquery(mysql, query, "OnAccountLoad", "i", playerid);
Registering :
mysql_format(mysql, query, sizeof(query), "INSERT INTO `players` ( `Name`, `Password`, `Tutorial`) VALUES ('%e', '%e', 0)", GetName(playerid), inputtext);
mysql_tquery(mysql, query, "OnAccountRegister", "i", playerid);
}
Tell me , how can i fix it
- Log("01:24:59","CMySQLQuery::Execute[]",1,"(error #1062) Duplicate entry '90' for key 'PRIMARY'",1);
Log("01:25:12","CMySQLQuery::Execute[]",1,"(error #1062) Duplicate entry '91' for key 'PRIMARY'",1);
Log("01:31:23","CMySQLQuery::Execute[]",1,"(error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '''' WHERE id = 431' at line 1",1);
Log("01:33:09","CMySQLQuery::Execute[]",1,"(error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''' at line 1",1);
From register , and loading i'm getting 'unkown where clause ' * player name * '
the functions i'm using is
//Login
mysql, query, sizeof(query), "SELECT * FROM `players` WHERE `Name` = '%e' LIMIT 1", GetName(playerid));
mysql_tquery(mysql, query, "OnAccountLoad", "i", playerid);
pawn Код:
forward OnAccountLoad(playerid);
public OnAccountLoad(playerid)
{
StopAudioStreamForPlayer(playerid);
IsSpawnedServer[playerid] = 1;
PlayerInfo[playerid][pMysqlID] = cache_get_field_content_int(0, "id");
PlayerInfo[playerid][pLevel] = cache_get_field_content_int(0, "PlayerLevel");
PlayerInfo[playerid][fActivity] = cache_get_field_content_int(0, "FactionActivity");
PlayerInfo[playerid][pHaveCard] = cache_get_field_content_int(0, "HaveCard");
Registering :
mysql_format(mysql, query, sizeof(query), "INSERT INTO `players` ( `Name`, `Password`, `Tutorial`) VALUES ('%e', '%e', 0)", GetName(playerid), inputtext);
mysql_tquery(mysql, query, "OnAccountRegister", "i", playerid);
}
pawn Код:
public OnAccountRegister(playerid)
{
PlayerInfo[playerid][pMysqlID] = cache_insert_id();
PlayerInfo[playerid][pLevel] = 1;
PlayerInfo[playerid][pLockedDays] = 0;