MySQL Reg/Login System [HELPME!] - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MySQL Reg/Login System [HELPME!] (
/showthread.php?tid=465303)
MySQL Reg/Login System [HELPME!] -
Fierro - 21.09.2013
pawn Код:
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.
Re: MySQL Reg/Login System [HELPME!] -
Fierro - 21.09.2013
Please, anyone? Is the "SELECT" statement syntax wrong or something? I keep seeing different versions of it everywhere.
If not, what's the problem?
Re: MySQL Reg/Login System [HELPME!] -
Fierro - 22.09.2013
Bump...somebody?