This commit is contained in:
parent
5d5e6a5cfb
commit
6298697169
@ -336,7 +336,7 @@ public class DatabaseManager
|
|||||||
|
|
||||||
if(!isInTable(playerName)) return -1;
|
if(!isInTable(playerName)) return -1;
|
||||||
|
|
||||||
String query = "SELECT ? FROM players " +
|
String query = "SELECT %param% FROM players " +
|
||||||
"WHERE player=? " +
|
"WHERE player=? " +
|
||||||
"LIMIT 1";
|
"LIMIT 1";
|
||||||
|
|
||||||
@ -348,11 +348,12 @@ public class DatabaseManager
|
|||||||
String priorityStr = "";
|
String priorityStr = "";
|
||||||
if(priority == 0) priorityStr = "main_pronoun_id";
|
if(priority == 0) priorityStr = "main_pronoun_id";
|
||||||
else if(priority == 1) priorityStr = "secondary_pronoun_id";
|
else if(priority == 1) priorityStr = "secondary_pronoun_id";
|
||||||
|
query = query.replace("%param%", priorityStr);
|
||||||
|
|
||||||
try(PreparedStatement pStatement = dbConnection.prepareStatement(query)) {
|
try(PreparedStatement pStatement = dbConnection.prepareStatement(query)) {
|
||||||
|
|
||||||
pStatement.setString(1, priorityStr);
|
pStatement.setString(1, playerName);
|
||||||
pStatement.setString(2, playerName);
|
|
||||||
|
|
||||||
ResultSet rSet = pStatement.executeQuery();
|
ResultSet rSet = pStatement.executeQuery();
|
||||||
if(rSet.isClosed()) return -1;
|
if(rSet.isClosed()) return -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user