MySQL hashed/escaped
#1

pawn Код:
new hashed[150], query[500];
WP_Hash(hashed, sizeof(hashed),inputtext);
mysql_real_escape_string(inputtext, hashed);
GetPlayerName(playerid, pInfo[playerid][pName], 24);
format(query, sizeof(query), "INSERT INTO `playerdata`(`user`, `password`, `age`, `email`) VALUES ('%s','%s',19,'noemail@yahoo.com')", pInfo[playerid][pName], hashed);
mysql_query(query);
Would this be the correct way to hash a password as well as prevent injection? Or if you are hashing it, do you even need to escape it?
Reply


Messages In This Thread
MySQL hashed/escaped - by BittleRyan - 27.03.2013, 22:36
Re: MySQL hashed/escaped - by Patrick - 27.03.2013, 22:40
Re: MySQL hashed/escaped - by Scenario - 27.03.2013, 22:46
Re: MySQL hashed/escaped - by BittleRyan - 27.03.2013, 22:54

Forum Jump:


Users browsing this thread: 1 Guest(s)