From 1ecb6b688cb99e93c4aea2444187595455865b8c Mon Sep 17 00:00:00 2001 From: shish Date: Thu, 5 Jul 2007 18:05:54 +0000 Subject: [PATCH] limit next / prev to 1 row git-svn-id: file:///home/shish/svn/shimmie2/trunk@221 7f39781d-f577-437e-ae19-be835c7a54ca --- core/database.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/database.class.php b/core/database.class.php index 3c3d6190..5d6d6563 100644 --- a/core/database.class.php +++ b/core/database.class.php @@ -252,13 +252,13 @@ class Database { } if(count($tags) == 0) { - $row = $this->db->GetRow("{$this->get_images} WHERE id $gtlt ? ORDER BY id $dir", array((int)$id)); + $row = $this->db->GetRow("{$this->get_images} WHERE id $gtlt ? ORDER BY id $dir LIMIT 1", array((int)$id)); } else { $tags[] = ($next ? "id<$id" : "id>$id"); $dir = ($next ? "DESC" : "ASC"); $querylet = $this->build_search_querylet($tags); - $querylet->append_sql("ORDER BY id $dir"); + $querylet->append_sql("ORDER BY id $dir LIMIT 1"); $row = $this->db->GetRow($querylet->sql, $querylet->variables); }