title: Ternary If statement for mysql query
body: <p>How can I add more ternary if-statements for my $sql variable? It outputs blank when I try to add more:</p>
  
  <p>Working:</p>
  
  <pre><code>$sql = "SELECT r.title,r.author,r.summary,r.posted_on,r.review_url,r.rating 
          FROM reviews r 
          LEFT JOIN websites w 
          ON w.id=r.website_id 
          WHERE w.rooftop_id=$rooftop_id
          AND review_site_id IN ($sites)
          AND rating &gt;= $star_threshold
          AND review_status_id=2
          " . ($pagination == 1 ? " LIMIT $offset, $review_limit " : "");
  </code></pre>
  
  <p>Not working:</p>
  
  <pre><code>$sql = "SELECT r.title,r.author,r.summary,r.posted_on,r.review_url,r.rating 
          FROM reviews r 
          LEFT JOIN websites w 
          ON w.id=r.website_id 
          WHERE w.rooftop_id=$rooftop_id
          AND review_site_id IN ($sites)
          AND rating &gt;= $star_threshold
          AND review_status_id=2
          " . ($pagination == 1 ? " LIMIT $offset, $review_limit " : "")
          " . ($rating_filter == 1 ? " ORDER BY r.rating " : "");
  </code></pre>