Delete Account from MySQL not work?!
#5

Quote:
Originally Posted by XStormiest
Посмотреть сообщение
Seems like it's not getting past this line: if(!strcmp(aName, szFieldName)) {
try to print something random on the console, and tell us if it prints out that text: for example: it works. If it doesn't work, it means smt is wrong. Put it in that areea: {strcmp...}
Like this, man?
PHP код:
CMD:delaccount(playeridparams[]){
    new 
aName[MAX_PLAYER_NAME], szFieldName[MAX_PLAYER_NAME], query[256], string[128];
    if(
Character[playerid][Admin] < 4) return System_Scm(playeridPERMISSIONONLYTYPE_ERROR);
    
CMD:delaccount(playeridparams[]){ 
    new 
aName[MAX_PLAYER_NAME], szFieldName[MAX_PLAYER_NAME], query[256], string[128]; 
    if(
Character[playerid][Admin] < 4) return System_Scm(playerid"You do not have permission to perform this command."TYPE_ERROR); 
    if(
sscanf(params"s[24]"aName)) return System_Scm(playerid"/delaccount [Account Name]"TYPE_NOTICE); 
    foreach(new 
iPlayer){ 
        if(!
strcmp(aNameGetPlayerNameEx(playerid))) { 
            print(
"Being Used");
            
format(stringsizeof(string), "Account [%s] is being used by Player ID [%d]"aNamei); 
            
System_Scm(playeridstringTYPE_ERROR); 
            return 
1
        }  
    } 
    new 
rows
    
cache_get_row_count(rows); 
    for(new 
row 0row rowsrow++){ 
        
cache_get_value_name(row"Username"szFieldName24); 
        
printf("%s - %s"aNameszFieldName); 
        if(!
strcmp(aNameszFieldName)) { 
            print(
"Found");
            
mysql_format(MHandlequerysizeof(query), "DELETE FROM `character` WHERE (`Username` = '%e') LIMIT 1"aName); 
            
mysql_query(MHandlequery); 
            
format(stringsizeof(string), "[%s] deleted [%s]"GetPlayerNameEx(playerid), aName); 
            foreach(new 
iPlayer) { 
                if(
Character[i][Admin] > 0System_Scm(playeridstringTYPE_SUCCESS); 
            } 
            return 
1
        }     
    } 
            print(
"Can't find");
    
format(stringsizeof(string), "Can't find account [%s]"aName); 
    
System_Scm(playeridstringTYPE_ERROR); 
    return 
1

I did it but It still doesn't print anything on the console when I perform the command.


Now i edit something and when I fill the online player name, it says 'Being Used', and when I fill the offline player name, it says 'Can't find' although that name is exist in my database.
It also doesn't print "%s - %s", so why? It has no condition to be allowed to perform.

I have printed the total tows onto the console.
Quote:

cache_get_row_count(rows);
printf("%d", rows);

It prints '0' row, I'm sure that my total rows are more than.
Does it get the total rows failed? How can i make it gets succesfully?
Reply


Messages In This Thread
[No subject] - by DuyDang2412 - 06.03.2017, 06:57
Re: Delete Account from MySQL not work?! - by XStormiest - 06.03.2017, 08:00
[No subject] - by DuyDang2412 - 06.03.2017, 08:03
Re: Delete Account from MySQL not work?! - by XStormiest - 06.03.2017, 08:10
XStormiest - by DuyDang2412 - 06.03.2017, 08:48
Re: Delete Account from MySQL not work?! - by StrikerZ - 06.03.2017, 09:07
Re: Delete Account from MySQL not work?! - by DuyDang2412 - 06.03.2017, 09:29
Re: Delete Account from MySQL not work?! - by DuyDang2412 - 06.03.2017, 09:31
Re: Delete Account from MySQL not work?! - by Runn3R - 06.03.2017, 13:30

Forum Jump:


Users browsing this thread: 1 Guest(s)