1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc limit 7' at line 1
in:
[select news_date_published from news_articles where news_status = '1' and to_days(news_date_published) <= to_days('2022-08-09') group by news_date_published desc limit 7]