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

Recommended Answers

All 6 Replies

Can you post the full error message? The title is cut off.

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

No. Like I said. There should be a space between DESC and LIMIT.

commented: damn space...:3 thanks alot sir +0
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.