Mysql /ChangeName Help
#1

Hi I'v Made Change Name System For Mysql But Does Not Work ... Anyone Can Fix It Tnx

PHP код:
CMD:changename(playeridparams[]) {
    if(
isnull(params)) {
        return 
SendClientMessage(playerid, -1"/changename [newname]");
    }
    if(
strlen(params) > MAX_PLAYER_NAME) {
        return 
SendClientMessage(playerid, -1"Your name must contain a maximum of 24 characters.");
    }
    new 
current[MAX_PLAYER_NAME];
    
GetPlayerName(playeridcurrentsizeof current);
    if(!
strcmp(currentparamsfalse)) {
        return 
SendClientMessage(playerid, -1"That's already your name!");
    }
    new 
query[128];
    
mysql_format(koneksiquerysizeof query"SELECT * FROM `players` WHERE `Username` = '%s'"params);
    
mysql_tquery(koneksiquery"ChangeName""is"playeridparams);
    return 
1;
}
forward ChangeName(playeridnewname[]);
public 
ChangeName(playeridnewname[]) {
    if(
cache_get_row_count(koneksi)) {
        return 
SendClientMessage(playerid, -1"This name is already in use!");
    }
    new 
current[MAX_PLAYER_NAME];
    
GetPlayerName(playeridcurrentsizeof current);
    new 
query[128];
    
mysql_format(koneksiquerysizeof query"UPDATE `players` SET `Username` = '%s' WHERE `Username` = '%s'"newnamecurrent);
    
mysql_tquery(koneksiquery);
    
SetPlayerName(playeridnewname);
    return 
1;

Reply
#2

I dont see anything wrong with code...Query is fine and everything else...
Check your mysql log...
Reply
#3

Quote:
Originally Posted by DRIFT_HUNTER
Посмотреть сообщение
I dont see anything wrong with code...Query is fine and everything else...
Check your mysql log...
Wow ! TnX + Rep And CanYou Give Me MySql Change PAssword Command?
Reply
#4

The error itself says Unknown column 'Username' in 'where clause'

Check your table properly for the correct column name. It's better if you use unique IDs if you have it assigned to their account.
Reply
#5

TnX + Rep You Too
Can You Give Me MySql Change PAssword Command?
Reply
#6

The way of making changepassword command is basically the same as changing the username. You just hash the password and update it in the table.
Reply
#7

Quote:
Originally Posted by Sjn
Посмотреть сообщение
The way of making changepassword command is basically the same as changing the username. You just hash the password and update it in the table.
Ok So Tnx
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)