PDA

View Full Version : MySQL Reg/Login System [HELPME!]


Fierro
21/09/2013, 07:59 PM
query = "SELECT `user` FROM playerdata WHERE user = '%s' AND password = SHA1('%s')";
new ffp[24];
mysql_real_escape_string(inputtext,ffp);
format(query,sizeof(query),query,pname,ffp);
mysql_query(query);
mysql_store_result();
new nrows = mysql_num_rows();
if(nrows == 1) LoginAccount(playerid);
if(nrows == 0)
{
ErrorMessage(playerid,"Error: Incorrect password (1)!");
ShowPlayerDialog(playerid,DIALOG_LOGIN,3,"Login to Account (Incorrect Password)","{FFFFFF}Please login to your {00FF00}Project Heist 92{FFFFFF} account with your password.","Login","");
}
mysql_free_result();

A small excerpt from the code, but it is all that is wrong. There are no compiler errors, and as a matter of fact, the code is loading properly as it returns "Error: Incorrect password (1)!", but it only returns that to the player! I've tried entering the correct password, but it just doesn't work! It's always an incorrect password! Can someone please help? Been trying to fix alone for days.

Fierro
21/09/2013, 09:26 PM
Please, anyone? Is the "SELECT" statement syntax wrong or something? I keep seeing different versions of it everywhere.

If not, what's the problem?

Fierro
22/09/2013, 12:39 AM
Bump...somebody?