title: This mysql query returns 500 server error
body: <p>I can't figure this out.  This query inserts a new record with all the fields as needed but for whatever reason, it gives me a 500 server error after the insertion returning neither true or false:</p>
  
  <pre><code>$connection = Database::getConnection();
  $query = "INSERT INTO reviews 
            VALUES ('0', (SELECT tbl_id FROM table WHERE brand = '$brand' AND model = '$model'), 
            (SELECT user_id FROM users WHERE user_name = '$user'), '$overall', '$lvalue', 
            '$pvalue', '$dvalue', '$vvalue', '$summary', 
            '$review', '$date')";
  $result = $connection -&gt; query($query);
  
     if (!$result || $result -&gt; affected_rows &lt; 1) {
        $result -&gt; close();
        return FALSE;
     } else {
        $result -&gt; close();
        return TRUE;
    }
  </code></pre>
  
  <p>Any help is GREATLY appreciated!</p>