12.08.2014, 14:42
Is there a better way of doing this query?
What I am doing is selecting the character name for four slots where the master account id matches.
pawn Код:
mysql_format(Connection, Query, sizeof Query, "SELECT `name` FROM `characters` WHERE `id` = %d LIMIT 1", MasterAccounts[playerid][maCharacter][0]);
mysql_function_query(Connection, Query, true, "SelectCharacterNames", "d", playerid);
mysql_format(Connection, Query, sizeof Query, "SELECT `name` FROM `characters` WHERE `id` = %d LIMIT 1", MasterAccounts[playerid][maCharacter][1]);
mysql_function_query(Connection, Query, true, "SelectCharacterNames", "d", playerid);
mysql_format(Connection, Query, sizeof Query, "SELECT `name` FROM `characters` WHERE `id` = %d LIMIT 1", MasterAccounts[playerid][maCharacter][2]);
mysql_function_query(Connection, Query, true, "SelectCharacterNames", "d", playerid);
mysql_format(Connection, Query, sizeof Query, "SELECT `name` FROM `characters` WHERE `id` = %d LIMIT 1", MasterAccounts[playerid][maCharacter][3]);
mysql_function_query(Connection, Query, true, "SelectCharacterNames", "d", playerid);