MySQL
#7

Quote:
Originally Posted by Misiur
Посмотреть сообщение
You don't have to use format, because you aren't inserting any value there. Also you have to cache the result:

pawn Код:
mysql_tquery(Database, "SELECT COUNT(`id`) FROM table_name", "SQLGetCount", "i", playerid);

//then later
forward SQLGetCount(playerid);
public SQLGetCount(playerid) {
    new
        string[64];

    //We always get exactly one row, no need to use cache_get_data
    format(string, sizeof(string), "We already have %i registered players.", cache_get_row_int(0, 0, Database));
    ShowPlayerDialog(playerid, DIALOGID, 0, "Welcome", string, "OK", "");

    return 1;
}
Thank you, REP+!
Reply


Messages In This Thread
MySQL - by Wizzy951 - 18.10.2013, 22:25
Respuesta: MySQL - by PabloDiCostanzo - 18.10.2013, 22:35
Re: Respuesta: MySQL - by Wizzy951 - 18.10.2013, 23:45
Re: MySQL - by Jefff - 19.10.2013, 00:06
Re: MySQL - by Wizzy951 - 19.10.2013, 10:40
Re: MySQL - by Misiur - 19.10.2013, 10:59
Re: MySQL - by Wizzy951 - 19.10.2013, 11:02

Forum Jump:


Users browsing this thread: 2 Guest(s)