Hey. I've got this code,
// query article
$query1 = "SELECT * FROM (articles LEFT JOIN authorisation ON articles.page_id = authorisation.page_id LEFT JOIN authors ON articles.author_id = authors.author_id) WHERE articles.page_id NOT IN (authorisation.page_id) ORDER BY issue ASC";
$mysql_result1 = mysql_query ($query1)
or die ("Query '$query1' failed with error message: \"" . mysql_error () . '"');
// Print
while($row = mysql_fetch_array($mysql_result1))
{
echo ' <tr>
<td>"' . $row['page_title'] . '"</td>
<td> (' . $row['page_id'] . ')</td>
<td class="lightgrey">' . $row['author'] . '</td>
</tr>
<tr class="comment">
<td colspan="3" id="comment' . $row['page_id'] . '">' . $row['authorisation_comment'] . '</td>
</tr>';
}
, and it's supposed to look for the following: if a row in 'articles' does not exist in 'authorisation' (based upon its "page_id"), it should return said row and put it into the table. When it does exist in both tables, ignore.
But obviously it's not working. Can anyone help me out?
(P.S. For convenience, I have left out every column that needs to be selected and replaced it with the all-encompassing *. In the actual code it only selects the needed columns.)