clankill3r Posted December 10, 2011 Share Posted December 10, 2011 I have a database with articles, i also have a database with ratings. The ratings.articleId is for articles.id, in example if ratings.articleId = 50 then it belongs to the one where articles.id = 50; $t is a number $query = "SELECT articles.id, articles.headline ratings.rating FROM articles "; $query .= "LEFT JOIN ratings ON (ratings.articleId=articles.id) "; $query .= "WHERE articles.id>'$t'"; this is the error atm: Query failed: 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 '.rating FROM articles LEFT JOIN ratings ON (ratings.articleId=articles.id) WHERE' at line 1 Link to comment https://forums.phpfreaks.com/topic/252881-problem-with-left-join/ Share on other sites More sharing options...
Pikachu2000 Posted December 10, 2011 Share Posted December 10, 2011 Comma. Link to comment https://forums.phpfreaks.com/topic/252881-problem-with-left-join/#findComment-1296532 Share on other sites More sharing options...
clankill3r Posted December 10, 2011 Author Share Posted December 10, 2011 thank god it was that simple. thanks Link to comment https://forums.phpfreaks.com/topic/252881-problem-with-left-join/#findComment-1296564 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.