21.03.2016, 18:13
Use format + strcat. Example:
Note that the specifier "%q" in format, is used to escape a string.
pawn Код:
new query[256], temp[128], player_name[MAX_PLAYER_NAME];
GetPlayerName(playerid, player_name, MAX_PLAYER_NAME);
format(temp, sizeof(temp), "SELECT `%s`,`%s`,`%s`,`%s`,`%s`");
strcat(query, temp);
format(temp, sizeof(temp), ",`%s`,`%s`,`%s`,`%s`,`%s` FROM `%s`");
strcat(query, temp);
format(temp, sizeof(temp), " WHERE `%s` = '%q'", player_name);
strcat(query, temp);