SQL Help
#5

Try like this
PHP код:
COMMAND:match(playeridparams[])
{
    if(!
PlayerInfo[playerid][power]) return SendClientError(playeridCANT_USE_CMD);
    new 
emri;
    if(
sscanf(params"u"emri)) return SCP(playerid"<partofname/playerid>");
    new 
sql[500], gpcija[64], Cache:result;
    
gpci(emrigpcijasizeof(gpcija));
    
mysql_format(sqldbsqlsizeof sql"SELECT * FROM `gpci` WHERE `gpci` = '%e'"gpcija);
    
result mysql_query(sqldbsql);
    new 
rows cache_num_rows();
    if(
rows 0)
    {
        for(new 
rowrow rowsrow++)
        {
            new 
emri1[128];
            
cache_get_field_content(row"name"emri1);
            
format(iStrsizeof(iStr), "{ff0000}%s matches with %s"emri1PlayerName(emri));
            
SendClientMessage(playerid, -1iStr);
        }
    }
    else
    {
        
SendClientMessage(playerid, -1"{ff0000}Can't find any!");
    }
    
cache_delete(result);
    return 
1;

Reply


Messages In This Thread
SQL Help - by fatlirmorina - 24.05.2017, 16:16
Re: SQL Help - by Banditul18 - 24.05.2017, 16:22
Re: SQL Help - by fatlirmorina - 24.05.2017, 16:29
Re: SQL Help - by fatlirmorina - 24.05.2017, 17:40
Re: SQL Help - by Banditul18 - 24.05.2017, 17:53

Forum Jump:


Users browsing this thread: 1 Guest(s)