SQL Problem
#1

What is wrong this this code? everytime I search player name, it always returns can't find any even tho if I check the database, there is some players with same gpci.

PHP код:
COMMAND:omatch(playeridparams[])
{
    if(!
PlayerInfo[playerid][power]) return SendClientError(playeridCANT_USE_CMD);
    new 
emri[32];
    if(
sscanf(params"s"emri)) return SCP(playerid"<Player_Name>");
    new 
sql[164], gpcija[64], Cache:result;
    
mysql_format(sqldbsqlsizeof sql"SELECT `PlayerInfo` FROM `gpci` WHERE `PlayerName` = '%s'"emri);
    
mysql_query(sqldbsql);
    
cache_get_field_content(0"gpci"gpcija);
    
mysql_format(sqldbsqlsizeof sql"SELECT * FROM `PlayerInfo` WHERE `gpci` = '%s'"gpcija);
    
result mysql_query(sqldbsql);
    new 
rows cache_num_rows();
    if(
rows)
    {
        new 
iStr128 ];
        for(new 
irowsi++)
        {
            new 
emri1[128];
            
cache_get_field_content(i"PlayerName"emri1);
            if(
strcmp(emri1emri))
            {
                
format(iStrsizeof(iStr), "{ea8080}[AC]:{f3c0c0} %s matches with %s"emri1emri);
                
SendClientMessage(playerid, -1iStr);
            }
        }
    }
    else
    {
        
SendClientMessage(playerid, -1"{ea8080}[AC]:{f3c0c0} Can't find any linked!");
    }
    
cache_delete(result);
    return 
1;

Reply


Messages In This Thread
SQL Problem - by ServerFiles - 24.08.2018, 02:43
Re: SQL Problem - by Nero_3D - 24.08.2018, 05:49
Re: SQL Problem - by ServerFiles - 24.08.2018, 08:48
Re: SQL Problem - by Nero_3D - 25.08.2018, 00:41
Re: SQL Problem - by ServerFiles - 25.08.2018, 02:30
Re: SQL Problem - by Sew_Sumi - 25.08.2018, 03:11

Forum Jump:


Users browsing this thread: 2 Guest(s)