MD5 and Mysql
#1

I got a problem with md5, I encrypted a password in a dialog and at phpmyadmin the password is encrypted , but i can't login, I try ed to encript the password when the player logs and query it but doesn't work, hope someone uses this include and can give me some help thanks.
The code:
pawn Код:
new query[100]; // Register Part
MD5_Hash(inputtext);
format(query, sizeof(query),"INSERT INTO playerdb (id,username,password,score) VALUES (NULL,'%s',md5('%s'),%d)",playerdb[playerid][username],inputtext,1);
mysql_query(query);

new query[150]; // login part
MD5_Hash(inputtext);
format(query, sizeof(query),"SELECT * FROM playerdb WHERE username = '%s' AND password = md5('%s')",playerdb[playerid][username],inputtext);
mysql_query(query);
Here is the include attachment.
Reply
#2

You dont have to use MD5_Hash .. try use only the md5('') on the query
Reply
#3

Quote:
Originally Posted by [ISS]jumbo
Посмотреть сообщение
You dont have to use MD5_Hash .. try use only the md5('') on the query
You was right i don't require to use the MD5 include, Mysql supports MD5 automatically but the problem was that i
was using varchar 50 for the password and i changed it to char 32 because MD5 is based 32 cells encriptation. Thank you anyway and reputation for you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)