summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoruckelman <uckelman@nomic.net>2010-04-11 12:54:04 +0000
committeruckelman <uckelman@nomic.net>2010-04-11 12:54:04 +0000
commit980d59332e0f8208dcb27a7b4f754e41158c7dc3 (patch)
tree99163c13d667ebf4e634cf75d6f181dc2d0e84be /src
parent2b7189767f4d5708948f3989df8c3d8084eab87a (diff)
Added setMessageIdIfAbsent().
git-svn-id: https://vassalengine.svn.sourceforge.net/svnroot/vassalengine/site-src/trunk@6639 67b53d14-2c14-4ace-a08f-0dab2b34000c
Diffstat (limited to 'src')
-rw-r--r--src/Bridge.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Bridge.php b/src/Bridge.php
index ad3b6c3..537fb5c 100644
--- a/src/Bridge.php
+++ b/src/Bridge.php
@@ -53,6 +53,14 @@ class Bridge {
return $row['forum_id'];
}
+ public function setMessageIdIfAbsent($messageId) {
+ $sql = 'INSERT IGNORE INTO posts (message_id) VALUES (' .
+ $this->db->quote($messageId) . ')';
+
+ $count = $this->db->exec($sql);
+ return $count == 1;
+ }
+
protected function get_exactly_one_row($sql) {
$result = $this->db->query($sql);