Skip to content

Commit

Permalink
Remove an useless ORDER BY.
Browse files Browse the repository at this point in the history
It improves compatibility with PgSQL.
  • Loading branch information
rledisez committed Jun 23, 2009
1 parent 2e6a1d6 commit c80d2da
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions modules/gallery/models/item.php
Expand Up @@ -382,8 +382,7 @@ public function get_position($child_id) {
SELECT COUNT(*) AS position FROM {items}
WHERE parent_id = {$this->id}
AND {$this->sort_column} <= (SELECT {$this->sort_column}
FROM {items} WHERE id = $child_id)
ORDER BY {$this->sort_column} {$this->sort_order}");
FROM {items} WHERE id = $child_id)");

return $result->current()->position;
}
Expand Down

0 comments on commit c80d2da

Please sign in to comment.