title: Sorting a sql database alphabetically with links/buttons
body: <p>Hello scripterfriends,</p>
  
  <p>I'm working on a project where I need to sort a row in alphabetical order. After searching for some solutions I didn't find the one I was looking for. Lets say I need only the products that start with the letter "F". I want it like the picture below: <a href="https://gyazo.com/488ccc8fd2beaadbc96d687938e5a6ff" rel="nofollow noreferrer">https://gyazo.com/488ccc8fd2beaadbc96d687938e5a6ff</a></p>
  
  <p>I need to be able to click the F and let it only show the product the start with the F.</p>
  
  <p>The code I have so does the trick but I need to change the code in order to get another letter. This is the code I have so far:</p>
  
  <pre><code>&lt;?php
  require_once 'config.php';
  
  try {
      $sQuery = "SELECT receptnummer, receptnaam, receptingredient, receptbereidingstijd, receptbereidingswijze, receptcategorie, receptbenodigdheden, receptserveertips, klantnummer
       FROM recept
       WHERE receptnaam LIKE '%f%' ORDER BY receptnaam";
  
      $oStmt = $db-&gt;prepare($sQuery);
  
      $oStmt-&gt;execute();
  
      if ($oStmt-&gt;rowCount() &gt; 0) {
          echo '&lt;table border="2"&gt;';
          echo '&lt;thead&gt;';
          echo '&lt;td&gt;receptnummer&lt;/td&gt;';
          echo '&lt;td&gt;receptnaam&lt;/td&gt;';
          echo '&lt;td&gt;receptingredient&lt;/td&gt;';
          echo '&lt;td&gt;receptbereidingstijd&lt;/td&gt;';
          echo '&lt;td&gt;receptbereidingswijze&lt;/td&gt;';
          echo '&lt;td&gt;receptcategorie&lt;/td&gt;';
          echo '&lt;td&gt;receptbenodigdheden&lt;/td&gt;';
          echo '&lt;td&gt;receptserveertips&lt;/td&gt;';
          echo '&lt;td&gt;klantnummer&lt;/td&gt;';
  
          while ($aRow = $oStmt-&gt;fetch(PDO::FETCH_ASSOC)) {
  
              echo '&lt;tr&gt;';
              echo '&lt;td&gt;' . $aRow['receptnummer'] . '&lt;/td&gt;';
              echo '&lt;td&gt;' . $aRow['receptnaam'] . '&lt;/td&gt;';
              echo '&lt;td&gt;' . $aRow['receptingredient'] . '&lt;/td&gt;';
              echo '&lt;td&gt;' . $aRow['receptbereidingstijd'] . '&lt;/td&gt;';
              echo '&lt;td&gt;' . $aRow['receptbereidingswijze'] . '&lt;/td&gt;';
              echo '&lt;td&gt;' . $aRow['receptcategorie'] . '&lt;/td&gt;';
              echo '&lt;td&gt;' . $aRow['receptbenodigdheden'] . '&lt;/td&gt;';
              echo '&lt;td&gt;' . $aRow['receptserveertips'] . '&lt;/td&gt;';
              echo '&lt;td&gt;' . $aRow['klantnummer'] . '&lt;/td&gt;';
              echo '&lt;/tr&gt;';
          }
          echo '&lt;/table&gt;';
      } else {
          echo 'helaas, geen gegevens gevonden';
      }
  
  } catch (PDOException $e) {
      $sMsg = '&lt;p&gt;
      Regelnummer: ' . $e-&gt;getLine() . '&lt;br/&gt;
      Bestand: ' . $e-&gt;getFile() . '&lt;br/&gt;
      Foutmelding: ' . $e-&gt;getMessage() . '
  &lt;/p&gt;';
  
      trigger_error($sMsg);
  }
  $db = null;
  ?&gt;
  </code></pre>
  
  <p>Can someone help me out on this one???</p>
  
  <p>Thanks in advance,</p>
  
  <p>DigitalDentist</p>