summaryrefslogtreecommitdiff
path: root/post.php
diff options
context:
space:
mode:
authorMichael Foster <savetheinternet@tinyboard.org>2013-07-31 22:14:26 -0400
committerMichael Foster <savetheinternet@tinyboard.org>2013-07-31 22:14:26 -0400
commita052a791b553c770ef407f91b697bef7a62df5b1 (patch)
treef49b8edf930f6d27fd14db4970107f128b02b992 /post.php
parent232f4ff8680e81dbee3902c01af6c702555fbc0f (diff)
Add optional database table prefix (issue #118; see issue comments for details)
Diffstat (limited to 'post.php')
-rw-r--r--post.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/post.php b/post.php
index f4499845..22782ca7 100644
--- a/post.php
+++ b/post.php
@@ -48,7 +48,7 @@ if (isset($_POST['delete'])) {
error($config['error']['nodelete']);
foreach ($delete as &$id) {
- $query = prepare(sprintf("SELECT `thread`, `time`,`password` FROM `posts_%s` WHERE `id` = :id", $board['uri']));
+ $query = prepare(sprintf("SELECT `thread`, `time`,`password` FROM ``posts_%s`` WHERE `id` = :id", $board['uri']));
$query->bindValue(':id', $id, PDO::PARAM_INT);
$query->execute() or error(db_error($query));
@@ -111,7 +111,7 @@ if (isset($_POST['delete'])) {
markup($reason);
foreach ($report as &$id) {
- $query = prepare(sprintf("SELECT `thread` FROM `posts_%s` WHERE `id` = :id", $board['uri']));
+ $query = prepare(sprintf("SELECT `thread` FROM ``posts_%s`` WHERE `id` = :id", $board['uri']));
$query->bindValue(':id', $id, PDO::PARAM_INT);
$query->execute() or error(db_error($query));
@@ -123,7 +123,7 @@ if (isset($_POST['delete'])) {
'/' . $board['dir'] . $config['dir']['res'] . sprintf($config['file_page'], $thread ? $thread : $id) . ($thread ? '#' . $id : '') .
' for "' . $reason . '"'
);
- $query = prepare("INSERT INTO `reports` VALUES (NULL, :time, :ip, :board, :post, :reason)");
+ $query = prepare("INSERT INTO ``reports`` VALUES (NULL, :time, :ip, :board, :post, :reason)");
$query->bindValue(':time', time(), PDO::PARAM_INT);
$query->bindValue(':ip', $_SERVER['REMOTE_ADDR'], PDO::PARAM_STR);
$query->bindValue(':board', $board['uri'], PDO::PARAM_INT);
@@ -227,7 +227,7 @@ if (isset($_POST['delete'])) {
//Check if thread exists
if (!$post['op']) {
- $query = prepare(sprintf("SELECT `sticky`,`locked`,`sage` FROM `posts_%s` WHERE `id` = :id AND `thread` IS NULL LIMIT 1", $board['uri']));
+ $query = prepare(sprintf("SELECT `sticky`,`locked`,`sage` FROM ``posts_%s`` WHERE `id` = :id AND `thread` IS NULL LIMIT 1", $board['uri']));
$query->bindValue(':id', $post['thread'], PDO::PARAM_INT);
$query->execute() or error(db_error());
@@ -583,7 +583,7 @@ if (isset($_POST['delete'])) {
if (isset($post['tracked_cites'])) {
foreach ($post['tracked_cites'] as $cite) {
- $query = prepare('INSERT INTO `cites` VALUES (:board, :post, :target_board, :target)');
+ $query = prepare('INSERT INTO ``cites`` VALUES (:board, :post, :target_board, :target)');
$query->bindValue(':board', $board['uri']);
$query->bindValue(':post', $id, PDO::PARAM_INT);
$query->bindValue(':target_board',$cite[0]);