Them
Компетентный
Добрый вечер, не создается аккаунт в БД, никаких ошибок нет.
Вот код кейса диалога создания аккаунта
ОШИБКИ С ЛОГА:
[22:28:10] [ERROR] error #1064 while executing query "INSERT INTO 'users'('name','password') VALUES ('tom','4886386886')": 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 ''users'('name','password') VALUES ('tom','4886386886')' at line 1
[22:28:12] [ERROR] error #1064 while executing query "INSERT INTO 'users'('name','password') VALUES ('tom','4886386886')": 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 ''users'('name','password') VALUES ('tom','4886386886')' at line 1
[22:30:23] [WARNING] duplicate connection detected: handle id 1 already exists with host = 'localhost', username = 'root' and database = 'users'
[22:30:36] [ERROR] error #1064 while executing query "INSERT INTO 'accounts'('name','password') VALUES ('tom','34343443343')": 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 ''accounts'('name','password') VALUES ('tom','34343443343')' at line 1
Если что данные MYSQL
Всего 3 параметра
id
name
password
Название база данных: users. А таблица с параметрами аккаунта называется - accounts
Вот код кейса диалога создания аккаунта
Код:
switch(dialogid)
{
case 9:
{
if(response)
{
static const fmt_query [] = "INSERT INTO 'accounts'('name','password') VALUES ('%s','%s')";
new query[sizeof(fmt_query)+(-2+MAX_PLAYER_NAME-2+32)];
format (query,sizeof(query), fmt_query, player_info[playerid][NAME], player_info[playerid][PASSWORD]);
mysql_query(dbHandle, query);
if(!strlen(inputtext)) // ÏÐÎÂÅÐÊÀ ÍÀ ÏÓÑÒÎÅ ÏÎËÅ
{
ShowRegistration(playerid);
return SendClientMessage(playerid,COLOR_RED, "[Îøèáêà] Âû äîëæíû ââåñòè ïàðîëü èíà÷å àêêàóíò íå áóäåò ñîçäàí.");
}
if(strlen(inputtext) < 8 || strlen(inputtext) > 32) // ÏÐÎÂÅÐÊÀ ÍÀ ÊÎËÈ×ÅÑÒÂÎ ÑÈÌÂÎËΠ ÏÀÐÎËÅ.
{
ShowRegistration(playerid);
return SendClientMessage(playerid,COLOR_RED, "[Îøèáêà] Äëèíà ïàðîëÿ äîëæíà áûòü îò 8-ìè äî 32-óõ ñèìâîëîâ");
}
new regex:rg_passwordcheck = regex_new("^[a-zA-Z0-9]{1,}$");
if(regex_check(inputtext, rg_passwordcheck))
{
strmid(player_info[playerid][PASSWORD], inputtext, 0, strlen(inputtext), 32);
}
else
{
ShowRegistration(playerid);
return SendClientMessage(playerid,COLOR_RED, "[Îøèáêà] Ïàðîëü ìîæåò ñîñòîÿòü òîëüêî èç ëàòèíñêèõ ñèìâîëîâ è ÷èñåë ëþáîãî ðåãèñòðà.");
}
regex_delete(rg_passwordcheck);
}
else
{
SendClientMessage(playerid,COLOR_RED, "[Îøèáêà] Âû çàêðûëè îêíî ðåãèñòðàöèè àêêàóíòà. Äëÿ òîãî ÷òîáû âûéòè ñ ñåðâåðà - èñïîëüçóéòå /quit.");
ShowPlayerDialog(playerid, -1, 0, " ", " ", " ", "");
return Kick(playerid);
}
}
[22:28:10] [ERROR] error #1064 while executing query "INSERT INTO 'users'('name','password') VALUES ('tom','4886386886')": 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 ''users'('name','password') VALUES ('tom','4886386886')' at line 1
[22:28:12] [ERROR] error #1064 while executing query "INSERT INTO 'users'('name','password') VALUES ('tom','4886386886')": 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 ''users'('name','password') VALUES ('tom','4886386886')' at line 1
[22:30:23] [WARNING] duplicate connection detected: handle id 1 already exists with host = 'localhost', username = 'root' and database = 'users'
[22:30:36] [ERROR] error #1064 while executing query "INSERT INTO 'accounts'('name','password') VALUES ('tom','34343443343')": 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 ''accounts'('name','password') VALUES ('tom','34343443343')' at line 1
Если что данные MYSQL
Всего 3 параметра
id
name
password
Название база данных: users. А таблица с параметрами аккаунта называется - accounts
Последнее редактирование:
