Skip to content

Commit

Permalink
Fixed faqs
Browse files Browse the repository at this point in the history
  • Loading branch information
PiggyPiglet committed Mar 9, 2019
1 parent 3a6557e commit aeb028f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -7,7 +7,7 @@ plugins {
}

group = 'me.piggypiglet'
version = '4.0.4.9'
version = '4.0.4.10'
mainClassName = 'me.piggypiglet.gary.GaryBootstrap'
sourceCompatibility = 1.8
targetCompatibility = 1.8
Expand Down
Expand Up @@ -21,7 +21,7 @@ public static boolean edit(String key, String value) {

public static String get(String key) {
try {
return MySQLUtils.getRow("gary_faq", new String[] {"key"}, new Object[] {key}).getString("value");
return MySQLUtils.getRow("gary_faq", new String[]{"key"}, new Object[]{key}).getString("value");
} catch (Exception ignored) {}

return "null";
Expand Down
Expand Up @@ -77,10 +77,10 @@ public static boolean set(String table, Map.Entry<String, Object> location, Map.
}

public static DbRow getRow(String table, String[] keys, Object[] values) {
String key = "`" + mysqlFormat(String.join("`=%s AND `", keys), values) + "`";
String key = "`" + mysqlFormat(String.join("`=%s AND `", keys) + "`=%s", values);

try {
return DB.getFirstRowAsync("SELECT * FROM `" + table + "` WHERE `" + key + ";").get();
return DB.getFirstRowAsync("SELECT * FROM `" + table + "` WHERE " + key + ";").get();
} catch (Exception e) {
e.printStackTrace();
}
Expand All @@ -100,7 +100,7 @@ public static List<DbRow> getRows(String table) {

public static boolean remove(String table, String[] keys, Object[] values) {
boolean success = false;
String key = "`" + mysqlFormat(String.join("`=%s AND `", keys), values) + "`";
String key = "`" + mysqlFormat(String.join("`=%s AND `", keys) + "`=%s", values);

try {
if (exists(table, keys, values)) {
Expand All @@ -115,7 +115,7 @@ public static boolean remove(String table, String[] keys, Object[] values) {
}

public static boolean exists(String table, String[] keys, Object[] values) {
String key = "`" + mysqlFormat(String.join("`=%s AND `", keys), values) + "`";
String key = "`" + mysqlFormat(String.join("`=%s AND `", keys) + "`=%s", values);
boolean exists = false;

try {
Expand Down

0 comments on commit aeb028f

Please sign in to comment.