Password hash for sql (small doubt)
#2

We check if the hashed inputtext equal the one on the database, if so we load the data

pawn Код:
new query[100], pname[24], pass[30];
GetPlayerName(playerid, pname, 24);
mysql_escape_string(inputtext , pass);

mysql_format(Connectionhandle, query, sizeof(query), "SELECT * FROM `playerdata` WHERE `password`= SHA1('%s') AND `user`='%s'", pass, pname);//change `password` to your password name.
new cache:result = mysql_query(MySQL, query);

if(cache_get_row_count() > 0)
{
    mysql_format(mysql, query, sizeof(query), "SELECT * FROM `` WHERE `user` = '%e' LIMIT 1",);
    mysql_tquery(mysql, query, "OnAccountLoad", "i", playerid);
}

cache_delete(result);
Reply


Messages In This Thread
Password hash for sql (small doubt) - by Bondage - 14.01.2015, 23:05
Re: Password hash for sql (small doubt) - by xVIP3Rx - 14.01.2015, 23:11
Re: Password hash for sql (small doubt) - by Abagail - 14.01.2015, 23:12
Re: Password hash for sql (small doubt) - by Bondage - 15.01.2015, 10:04
Re: Password hash for sql (small doubt) - by xVIP3Rx - 15.01.2015, 10:13

Forum Jump:


Users browsing this thread: 2 Guest(s)