From 4d127b3a17d130c16c3fe255be5d4b98cf7e930d Mon Sep 17 00:00:00 2001 From: shish Date: Tue, 1 May 2007 12:40:39 +0000 Subject: [PATCH] select image by hash, for dupe detection git-svn-id: file:///home/shish/svn/shimmie2/trunk@42 7f39781d-f577-437e-ae19-be835c7a54ca --- core/database.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/database.class.php b/core/database.class.php index 87d753fe..aa557c21 100644 --- a/core/database.class.php +++ b/core/database.class.php @@ -229,6 +229,12 @@ class Database { return ($row ? new Image($row) : null); } + public function get_image_by_hash($hash) { + $image = null; + $row = $this->db->GetRow("SELECT * FROM images WHERE hash=?", array($hash)); + return ($row ? new Image($row) : null); + } + public function remove_image($id) { $this->db->Execute("DELETE FROM images WHERE id=?", array($id)); }