Change Password
#1

PHP код:
case DIALOG_CHANGEPS2:
        {
            if(
response)
            {
                if(!
strlen(inputtext)) // if nothing is entered in the dialog
                
{
                    
SendClientMessage(playeridRED"You must enter a password.");
                }
                new 
string[128];
                new 
hashpass[129]; // the whirlpool uses a 129 length string for hashing the password.
                
WP_Hash(hashpasssizeof(hashpass), inputtext); // to hash the input data
                
format(stringsizeof(string), "Your password is: %s"inputtext); // we have formatted a string to include variables inside it
                
SendClientMessage(playerid, -1string); // sending the above string message
                
new query[256];
                
WP_Hash(pData[playerid][Password], 129inputtext); //hashing inputtext
                
mysql_format(mysqlquerysizeof(query), "UPDATE `accounts` SET `Password`=%s WHERE `Username`='%s'",
                
pData[playerid][Password], Name[playerid]);
                 
mysql_tquery(mysqlquery"""");
                return 
1;
            }
        } 
command is working fine but password isnot saving nor i see any anything on mysql.log about this command.
Reply
#2

You need to put strings between apostrophes if you are sending a query. Like this
Код:
UPDATE `accounts` SET `Password`= '%s' WHERE `Username`='%s'
Reply
#3

PHP код:
UPDATE accounts SET Password '%s' WHERE Username '%s' 
What's up with all those apostros?
Reply
#4

thanks guys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)