aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid M <davidmj@users.sourceforge.net>2006-06-18 15:50:00 +0000
committerDavid M <davidmj@users.sourceforge.net>2006-06-18 15:50:00 +0000
commitac3f3b1ae94f8a820063fc816500dc2eb9a603b2 (patch)
tree3c0101841fdebfcab13b00dd7d13f4e60458991e
parent5735c5176e65905f8814b935000247fc8a4a88d0 (diff)
downloadforums-ac3f3b1ae94f8a820063fc816500dc2eb9a603b2.tar
forums-ac3f3b1ae94f8a820063fc816500dc2eb9a603b2.tar.gz
forums-ac3f3b1ae94f8a820063fc816500dc2eb9a603b2.tar.bz2
forums-ac3f3b1ae94f8a820063fc816500dc2eb9a603b2.tar.xz
forums-ac3f3b1ae94f8a820063fc816500dc2eb9a603b2.zip
SQL!
git-svn-id: file:///svn/phpbb/trunk@6100 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r--phpBB/includes/acp/acp_reasons.php36
1 files changed, 32 insertions, 4 deletions
diff --git a/phpBB/includes/acp/acp_reasons.php b/phpBB/includes/acp/acp_reasons.php
index d6e15435ee..90ec2ddb55 100644
--- a/phpBB/includes/acp/acp_reasons.php
+++ b/phpBB/includes/acp/acp_reasons.php
@@ -198,10 +198,38 @@ class acp_reasons
$other_reason_id = (int) $db->sql_fetchfield('reason_id');
$db->sql_freeresult($result);
- // Change the reports using this reason to 'other'
- $sql = 'UPDATE ' . REPORTS_TABLE . '
- SET reason_id = ' . $other_reason_id . ", report_text = CONCAT('" . $db->sql_escape($reason_row['reason_description']) . "\n\n', report_text)
- WHERE reason_id = $reason_id";
+ switch (SQL_LAYER)
+ {
+ // The ugly one!
+ case 'mysqli':
+ case 'mysql4':
+ case 'mysql':
+ // Change the reports using this reason to 'other'
+ $sql = 'UPDATE ' . REPORTS_TABLE . '
+ SET reason_id = ' . $other_reason_id . ", report_text = CONCAT('" . $db->sql_escape($reason_row['reason_description']) . "\n\n', report_text)
+ WHERE reason_id = $reason_id";
+ break;
+
+ // Nearly standard, not quite
+ case 'mssql':
+ case 'mssql_odbc':
+ // Change the reports using this reason to 'other'
+ $sql = 'UPDATE ' . REPORTS_TABLE . '
+ SET reason_id = ' . $other_reason_id . ", report_text = '" . $db->sql_escape($reason_row['reason_description']) . "\n\n' + report_text
+ WHERE reason_id = $reason_id";
+ break;
+
+ // Teh standard
+ case 'postgres':
+ case 'oracle':
+ case 'firebird':
+ case 'sqlite':
+ // Change the reports using this reason to 'other'
+ $sql = 'UPDATE ' . REPORTS_TABLE . '
+ SET reason_id = ' . $other_reason_id . ", report_text = '" . $db->sql_escape($reason_row['reason_description']) . "\n\n' || report_text
+ WHERE reason_id = $reason_id";
+ break;
+ }
$db->sql_query($sql);
$db->sql_query('DELETE FROM ' . REPORTS_REASONS_TABLE . ' WHERE reason_id = ' . $reason_id);