diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2010-02-19 03:18:55 +0100 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2010-02-19 03:18:55 +0100 |
commit | ff117414b781ac8bcfa512001af252ab44d61592 (patch) | |
tree | 9350198e0e3db76831281b0fe45c2302458e1778 /paste/include/storage/MysqlStorage.php | |
parent | 82b803a304b7c58338130b305a2adae95b0d3e07 (diff) | |
download | rafb-nopaste-ff117414b781ac8bcfa512001af252ab44d61592.tar.gz rafb-nopaste-ff117414b781ac8bcfa512001af252ab44d61592.tar.xz rafb-nopaste-ff117414b781ac8bcfa512001af252ab44d61592.zip |
added delContent
Diffstat (limited to 'paste/include/storage/MysqlStorage.php')
-rw-r--r-- | paste/include/storage/MysqlStorage.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/paste/include/storage/MysqlStorage.php b/paste/include/storage/MysqlStorage.php index 49af59e..5dd24c3 100644 --- a/paste/include/storage/MysqlStorage.php +++ b/paste/include/storage/MysqlStorage.php @@ -123,6 +123,21 @@ INDEX (nick) echo PastifyText($content, $lang, $description); } } + + public function delContent($pid) + { + if ($stmt = $this->mysql->prepare('DELETE FROM ' . $this->table . ' WHERE pid = ? LIMIT 1')) + { + $stmt->bind_param('s', $pid); + + /* execute query */ + if (!$stmt->execute()) { + header('HTTP/1.0 503 Service Unavailable'); + die('MySQL Error (' . $this->mysql->errno . ') ' . + $this->mysql->error); + } + } + } } ?> |