MySQL R33+ (small help)
#6

Quote:
Originally Posted by bgedition
Посмотреть сообщение
Try with this:
pawn Код:
new pname[24];
    GetPlayerName(playerid, pname, 24);
    mysql_format(/*mysql connection*/, query, sizeof(query), "SELECT `Banned` FROM `players` WHERE `user` = '%s' AND `Banned` = 1 LIMIT 1", pname);
    mysql_tquery(/*mysql connection*/, query, "", "");

    new rows, fields;
    cache_get_data(rows, fields, /*mysql connection*/);
    if(rows)
    {
        ShowPlayerDialog(playerid, 2344, DIALOG_STYLE_MSGBOX,"Name is banned from the server","Your name is banned from the server!\n post it in the Unban appeals Category.","OK","");
        Kick(playerid);
    }
Can ya explain me what is that /*mysql connection*/ ?

pawn Код:
mysql_format(/*mysql connection*/, query, sizeof(query), "SELECT `Banned` FROM `players` WHERE `user` = '%s' AND `Banned` = 1 LIMIT 1", pname);
mysql_tquery(/*mysql connection*/, query, "", "");


cache_get_data(rows, fields, /*mysql connection*/);
Actually i'm using this in place of that, is there anything wrong with it?

pawn Код:
static mysql; //i'm using this
mysql_format(mysql, query, sizeof(query), "SELECT `Banned` FROM `players` WHERE `user` = '%s' AND `Banned` = 1 LIMIT 1", pname);
mysql_tquery(mysql, query, "", "");


cache_get_data(rows, fields, mysql);
Reply


Messages In This Thread
MySQL R33+ (small help) - by Bondage - 13.01.2015, 16:09
Re: MySQL R33+ (small help) - by HazardouS - 13.01.2015, 16:24
Re: MySQL R33+ (small help) - by Bondage - 13.01.2015, 16:27
Re: MySQL R33+ (small help) - by Bondage - 13.01.2015, 18:40
Re: MySQL R33+ (small help) - by bgedition - 13.01.2015, 19:59
Re: MySQL R33+ (small help) - by Bondage - 13.01.2015, 21:18
Re: MySQL R33+ (small help) - by HazardouS - 13.01.2015, 21:51
Re: MySQL R33+ (small help) - by Bondage - 13.01.2015, 22:04

Forum Jump:


Users browsing this thread: 1 Guest(s)