limit next / prev to 1 row
git-svn-id: file:///home/shish/svn/shimmie2/trunk@221 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
parent
431b6a653e
commit
1ecb6b688c
@ -252,13 +252,13 @@ class Database {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(count($tags) == 0) {
|
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 {
|
else {
|
||||||
$tags[] = ($next ? "id<$id" : "id>$id");
|
$tags[] = ($next ? "id<$id" : "id>$id");
|
||||||
$dir = ($next ? "DESC" : "ASC");
|
$dir = ($next ? "DESC" : "ASC");
|
||||||
$querylet = $this->build_search_querylet($tags);
|
$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);
|
$row = $this->db->GetRow($querylet->sql, $querylet->variables);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user