Basically I have a mysql query something like the following:
mysql_query("SELECT n.title, v.value FROM posts n INNER JOIN votes v ON n.id = v.id");
And what I need to do is to grab the title from the posts table and the current vote value from the votes table.
At the moment, votes aren't stored into the votes table unless a vote happens. So all posts with 0 votes aren't in the votes table.
This causes an error that it's trying to get the title AND vote value where the post id = the vote value id. If there isn't any record in the votes table, then value should return as NULL or 0 but at the moment the whole query returns as null so I can't even return the title.
How can I fix this all in one query? I don't want to have to use multiple queries... Thanks :)