diff --git a/news/news.go b/news/news.go index 094930d..f120c76 100644 --- a/news/news.go +++ b/news/news.go @@ -94,7 +94,7 @@ func Get(db *sql.DB, id int) (*News, error) { func LoadPage(db *sql.DB, offset, amount int) ([]*News, int, error) { categories.LoadCategories(db) // required by addContainer - rows, err := db.Query("SELECT " + SQL_NEWS_FIELDS + " FROM news order by timestamp DESC") + rows, err := db.Query("SELECT " + SQL_NEWS_FIELDS + " FROM news ORDER BY timestamp DESC LIMIT $1 OFFSET $2", amount, offset) if err != nil { fmt.Println("DB errpr reading LoadPage news: ", err) return nil, 0, err