Fix SQL issue
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Bea 2022-10-24 22:44:12 +02:00
parent 5d5e6a5cfb
commit 6298697169

View File

@ -336,8 +336,8 @@ public class DatabaseManager
if(!isInTable(playerName)) return -1;
String query = "SELECT ? FROM players " +
"WHERE player = ? " +
String query = "SELECT %param% FROM players " +
"WHERE player=? " +
"LIMIT 1";
@ -348,11 +348,12 @@ public class DatabaseManager
String priorityStr = "";
if(priority == 0) priorityStr = "main_pronoun_id";
else if(priority == 1) priorityStr = "secondary_pronoun_id";
query = query.replace("%param%", priorityStr);
try(PreparedStatement pStatement = dbConnection.prepareStatement(query)) {
pStatement.setString(1, priorityStr);
pStatement.setString(2, playerName);
pStatement.setString(1, playerName);
ResultSet rSet = pStatement.executeQuery();
if(rSet.isClosed()) return -1;