From 2baa8cbe4e044dedbdb9bd9668732f5a2b1a36fc Mon Sep 17 00:00:00 2001 From: Ruan Date: Thu, 19 Feb 2015 13:56:07 +0200 Subject: [PATCH] Fix table_prefix support --- bans.php | 2 +- includes/data/database.php | 1 + mutes.php | 2 +- warnings.php | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bans.php b/bans.php index 48a221c..1499683 100644 --- a/bans.php +++ b/bans.php @@ -7,7 +7,7 @@ // <<-----------------mysql Database Connection------------>> // require 'includes/data/database.php'; -$sql = 'SELECT time,until,reason,name,banned_by_name FROM ' . $table_bans . ' INNER JOIN history on bans.uuid=history.uuid WHERE active=1 GROUP BY name ORDER BY time DESC LIMIT 20'; +$sql = 'SELECT time,until,reason,name,banned_by_name FROM ' . $table_bans . ' INNER JOIN ' . $table_history . ' on ' . $table_bans . '.uuid=' . $table_history . '.uuid WHERE active=1 GROUP BY name ORDER BY time DESC LIMIT 20'; $retval = mysql_query($sql, $conn); if (!$retval) { diff --git a/includes/data/database.php b/includes/data/database.php index 29f1798..5902a0c 100644 --- a/includes/data/database.php +++ b/includes/data/database.php @@ -8,6 +8,7 @@ $table_prefix = ""; $table_bans = $table_prefix . "bans"; $table_mutes = $table_prefix . "mutes"; $table_warnings = $table_prefix . "warnings"; +$table_history = $table_prefix . "history"; if (!$conn) { die('Could not connect: ' . mysql_error()); diff --git a/mutes.php b/mutes.php index c90c52c..2247ce1 100644 --- a/mutes.php +++ b/mutes.php @@ -7,7 +7,7 @@ // <<-----------------mysql Database Connection------------>> // require 'includes/data/database.php'; -$sql = 'SELECT time,until,reason,name,banned_by_name FROM ' . $table_mutes . ' INNER JOIN history on mutes.uuid=history.uuid WHERE active=1 GROUP BY name ORDER BY time DESC LIMIT 20'; +$sql = 'SELECT time,until,reason,name,banned_by_name FROM ' . $table_mutes . ' INNER JOIN ' . $table_history . ' on ' . $table_bans . '.uuid=' . $table_history . '.uuid WHERE active=1 GROUP BY name ORDER BY time DESC LIMIT 20'; $retval = mysql_query($sql, $conn); if (!$retval) { diff --git a/warnings.php b/warnings.php index 0e3e5cc..b39f86e 100644 --- a/warnings.php +++ b/warnings.php @@ -7,7 +7,7 @@ // <<-----------------mysql Database Connection------------>> // require 'includes/data/database.php'; -$sql = 'SELECT time,until,reason,name,banned_by_name FROM ' . $table_warnings . ' INNER JOIN history on warnings.uuid=history.uuid WHERE active=1 GROUP BY name ORDER BY time DESC LIMIT 20'; +$sql = 'SELECT time,until,reason,name,banned_by_name FROM ' . $table_warnings . ' INNER JOIN ' . $table_history . ' on ' . $table_bans . '.uuid=' . $table_history . '.uuid WHERE active=1 GROUP BY name ORDER BY time DESC LIMIT 20'; $retval = mysql_query($sql, $conn); if (!$retval) {