$stmt = $db->prepare('SELECT postID, postTitle, postSlug, postDesc, postDate FROM blog_posts WHERE postDate >= :from AND postDate <= :to ORDER BY postID DESC'.$pages->get_limit());

is there something wrong with my query?

edit: nevermind

BTW, I now see that there is no space between DESC and your limit value. Fix that. Not sure what limit returns, but that appears the cause of your issue.

oh.sorry..its like this sir
SQLSTATE[42000]: Syntax error or access violation: 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 'DESCLIMIT 0,5' at line 1...

should i post the whole code?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.