title: What's the Correct Syntax to query a Database in Laravel?
body: <p>I want to query my database to give me the ID numbers of all entries with a math score of 50 and below but can't seem to get the syntax right.</p>
  
  <p>This is what I tried, I don't get any error, it just doesn't work.</p>
  
  <pre><code>&lt;?php
  
  if ($dumby-&gt;ajax()) {
      // Scan database, find any score lower than 50, then copy the ID for that row.
      $output_array[] = "";
      $output = "branson";
  
      $trailers = DB::table('dataentries')-&gt;where('Eng_Algebra', '=&lt;', '50')-&gt;get();
      if ($trailers) {
          foreach ($trailers as $key =&gt; $trailers) {
              array_push($output_array, $trailers-&gt;Eng_Algebra);
          }
      }
  }
  </code></pre>