problem with database SQLite

Started by SA:MP, May 05, 2023, 05:45 AM

Previous topic - Next topic

0 Members and 5 Guests are viewing this topic.

SA:MP

problem with database SQLite

Heyy, I have a problem with my database (SQLite). When I register an account, everything works fine, the system saves the name and its respective password, but, when I log back in, it asks me to enter my account password, right? Well, when I enter the password, it tells me that it is WRONG (and I have entered the correct password), and it is a problem that I have still been able to solve (the game mode is made from 0 for my, forgive my ignorance, I am learning).



Code:


HTML Code:

		case D_LOGIN:
{
if(!response) return Kick(playerid);
{
new DBResult:resultado, l_sQuery[350];
format(l_sQuery, sizeof(l_sQuery), "SELECT * FROM `USUARIOS` WHERE Nick = '%q' COLLATE NOCASE AND Password = '%q'", GetPlayerNameEx(playerid), PI[playerid][e_sPassword]);
resultado = db_query(edb, l_sQuery);
if(db_num_rows(resultado))
{
new l_sString[70];

CargarCuenta(playerid);

PI[playerid][e_bSesion] = true;

PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);

format(l_sString, sizeof(l_sString), "Welcome!, %s", GetPlayerNameEx(playerid));
Mensaje(playerid, -1, l_sString);
}
else
{
ShowPlayerDialog(playerid, D_LOGIN, DIALOG_STYLE_PASSWORD, "{FFFFFF}Log In", "{FFBF00}* {FF6262}ERROR: {FFFFFF}The entered password is incorrect.\n{FFBF00}* {FFFFFF}Please re-enter the account password to log in.", "Join", "Leave");
}
db_free_result(resultado);
}
}


Source: problem with database SQLite