son.of.the.morning Posted December 21, 2011 Share Posted December 21, 2011 can any one see anythin wrong with the syntax here i keep getting an error SELECT * FROM blog_posts ORDER BY id DESC LIMIT $start, $per_page INTER JOIN table2 ON blog_posts.id=table2.id Quote Link to comment https://forums.phpfreaks.com/topic/253606-sql-error/ Share on other sites More sharing options...
AyKay47 Posted December 21, 2011 Share Posted December 21, 2011 a couple of things actually, the order by and limit clauses in most cases go at the end of your query, always after a JOIN, and its INNER not INTER Edit: ManiacDan provided a good reference to use when you are confused about which order your clauses go in. Quote Link to comment https://forums.phpfreaks.com/topic/253606-sql-error/#findComment-1300070 Share on other sites More sharing options...
ManiacDan Posted December 21, 2011 Share Posted December 21, 2011 The proper order of keywords in a MySQL SELECT statement, per the manual, is: SELECT FROM [JOIN] [WHERE] [GROUP BY] [ORDER BY] [LIMIT] Quote Link to comment https://forums.phpfreaks.com/topic/253606-sql-error/#findComment-1300071 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.