Jump to content

problem with LEFT JOIN


clankill3r

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.