Рекомендованные сообщения



Не найдено.

1 post in this topic

Подскажите что делать, в моде ошибок не выдает, а в mysql логе выдает еррор cache_get_value_name_int: field 'id' not found

 if(playertextid == Reg[playerid][5])
    {
	SPD(playerid, DLG_REF, DIALOG_STYLE_INPUT, !"{ffb200}Ðåãèñòðàöèÿ ~ {FFFFFF}Ââîä ïðèãëàñèâøåãî",
		!"{FFFFFF}Åñëè òû çàø¸ë íà ñåðâåð ïî ïðèãëàøåíèþ, òî\n\
		ìîæåøü óêàçàòü íèê ïðèãëàñèâøåãî â ïîëå íèæå:",
	!"Äàëåå", "Ïðîïóñòèòü");
    }
		case DLG_REF:
		{
  			if(response)
	        {
				static const fmt_query[] = "SELECT * FROM `users` WHERE `name` = '%e'";
				new query[sizeof(fmt_query)+(-2+MAX_PLAYER_NAME)];
				mysql_format(dbHandle, query, sizeof(query), fmt_query, inputtext);
				mysql_tquery(dbHandle, query, "CheckReferal", "is", playerid, inputtext);
	        }
			else
			{
       			player_info[playerid][REFERAL] = 0;
				SPD(playerid, -1, 0, " ", " ", " ", "");
			}
		}
forward CheckReferal(playerid, referal[]);
public CheckReferal(playerid, referal[])
{
	new rows;
	cache_get_row_count(rows);
	if(rows)
	{
	    cache_get_value_name_int(0, "id", player_info[playerid][REFERAL]);
	    SPD(playerid, -1, 0, " ", " ", " ", "");
	}
	else
	{
	    SPD(playerid, DLG_REF, DIALOG_STYLE_INPUT, !"{ff9300}Ðåãèñòðàöèÿ{FFFFFF} • Ââîä ïðèãëàñèâøåãî",
			!"{FFFFFF}Åñëè òû çàø¸ë íà ñåðâåð ïî ïðèãëàøåíèþ, òî\n\
			ìîæåøü óêàçàòü íèê ïðèãëàñèâøåãî â ïîëå íèæå:",
		!"Äàëåå", !"Ïðîïóñòèòü");
        return SCM(playerid, COLOR_ERROR, !"[Îøèáêà] {FFFFFF}Àêêàóíòà ñ òàêèì íèêîì íå ñóùåñòâóåò");
	}
	return 1;
}

stock CreateAccountEx(playerid)
{
    if(!strcmp(player_info[playerid][PASSWORD], "Password", true)) return SendClientMessage(playerid, -1, "Âû íå çàïîëíèëè ïîëå 'Password'");
    if(!strcmp(player_info[playerid][EMAIL], "Email", true)) return SendClientMessage(playerid, -1, "Âû íå çàïîëíèëè ïîëå 'Email'");
    if(player_info[playerid][SEX] == 0) return SendClientMessage(playerid, -1, "Âû íå çàïîëíèëè ïîëå 'Sex'");
    if(player_info[playerid][AGE] < 18 || player_info[playerid][AGE] > 60) return SendClientMessage(playerid, -1, "Âû íå çàïîëíèëè ïîëå 'Age'");
    for(new i = 0; i < 20; i++) PlayerTextDrawHide(playerid, Reg[playerid][i]);
    CancelSelectTextDraw(playerid);
	static const fmt_query[] = "INSERT INTO `users` (`name`, `password`, `email`, `referal`, `sex`, `age`) VALUES ('%e', '%e', '%e', '%d', '%d', '%d')";
	new query[sizeof(fmt_query)+(-2+MAX_PLAYER_NAME)+(-2+64)+(-2+64)+(-2+8)+(-2+1)+(-2+2)];
	mysql_format(dbHandle, query, sizeof(query), fmt_query, player_info[playerid][NAME], player_info[playerid][PASSWORD], player_info[playerid][EMAIL], player_info[playerid][REFERAL], player_info[playerid][SEX], player_info[playerid][AGE]);
	mysql_query(dbHandle, query, false);
    TogglePlayerSpectating(playerid, false);
    PlayerGoLogin(playerid);
    return 1;
}

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • Guest Андрей
      By Guest Андрей
      Сделал логи для сервера, но в БД не идет, пишет ошибку #1064 (MySQL), почитал на других форумах, там написано что из за размера, но с размером все хорошо.
       
       
       
       
       
      P/s: В таблицу тоже ничего не записывается