0
$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?

3
Contributors
6
Replies
25
Views
3 Years
Discussion Span
Last Post by pritaeas
1

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.

Edited by pritaeas

0

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...

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.