title: What's wrong with this INNER JOIN SQL query?
body: <p>I have three tables, tblMembers, tblBooks and tblReviews. The idea is a book review website.</p>
  
  <p>Currently the Book Title is only displayed if there are reviews written for it, however I want the book title to always be displayed along with; either a list of reviews, or, the text, 'this title has not yet been reviewed.'</p>
  
  <p>What is wrong with this SQL query?</p>
  
  <pre><code>$sql = "
  SELECT *
  FROM tblBooks
  INNER JOIN tblReviews
  ON tblBooks.bookID = tblReviews.bookID
  INNER JOIN tblMembers
  ON tblReviews.userID = tblMembers.userID
  WHERE tblReviews.bookID = :bookID";
  
  
  $query = $odb-&gt;prepare($sql);
  
      $query-&gt;execute(array(":bookID" =&gt; $bookID));
  
      $results = $query-&gt;fetchAll();
      echo "&lt;h1&gt;".$results[0]['longTitle']."&lt;/h1&gt;";
      if($results !== FALSE &amp;&amp; $query-&gt;rowCount()&gt;0) {
          foreach($results as $result) {
              echo "Reviewed by: " . $result['firstName'] . " " . $result['lastName'];
              echo "&lt;br /&gt;";
              echo "Rating: " . $result['rating']."/100";
              echo "&lt;br /&gt;";
              echo "Date: " . $result['reviewDate'] . " " . $result['reviewTime'];
              echo "&lt;br /&gt;";
              echo "Review:";
              echo "&lt;br /&gt;";
              echo $result['reviewText'];
              echo "&lt;hr /&gt;";
          }
      } else { // the book has not been reviewed yet
          echo "There are no reviews for this title yet";
      }
  </code></pre>
  
  <p>As mentioned above, the line <code>echo "&lt;h1&gt;".$results[0]['longTitle']."&lt;/h1&gt;";</code> is only executed if the book has reviews, I want to get the book details prior to checking if it has reviews or not. How can I do this?</p>
  
  <p>On another note, how can I check which books haven't been reviewed yet and populate a drop down list with the results? - This has been answered :D</p>
  
  <p>How can I either:</p>
  
  <p>Populate two separate drop down lists, one for books that have reviews and one for books that haven't been reviewed yet (this one I can do as I have the SQL from the question above).</p>
  
  <p>OR</p>
  
  <p>Populate the single dropdown list but put books that have reviews at the top, separated by a string of characters, let's say "---------- THESE BOOKS HAVEN'T BEEN REVIEWED YET ----------" followed by the books that haven't yet been reviewed. Is this possible?</p>