limit for next / prev search
git-svn-id: file:///home/shish/svn/shimmie2/branches/branch_2.0@222 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
parent
eccd9f590a
commit
467bb635c4
@ -219,13 +219,13 @@ class Database {
|
||||
}
|
||||
|
||||
if(count($tags) == 0) {
|
||||
$row = $this->db->GetRow("SELECT * FROM images WHERE id $gtlt ? ORDER BY id $dir", array((int)$id));
|
||||
$row = $this->db->GetRow("SELECT * FROM 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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user