title: Search through Postgresql using search bar, then display it
body: <p><strong>The Problem</strong></p>
  
  <p>Hello, I am creating a search function that will allow users to search for a specific E-Number and see whether it is derived from animals or not, basically seeing if it's vegan. I have successflly connected to the database using PHP on my website but the pg_query.</p>
  
  <p><strong>What I Want to Happen:</strong></p>
  
  <p>I want a user to being able to search for an E-number in a seach bar like the example below:</p>
  
  <p><a href="https://i.stack.imgur.com/fTyLV.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fTyLV.jpg" alt="enter image description here"></a> </p>
  
  <p>There is four columns in the table, I want to allow the user to search through one, this being 'code', and then displaying an answer, this being the 'vegan' column in my database.</p>
  
  <p><strong>The Code so far</strong></p>
  
  <pre><code>&lt;?php       
      // Connecting, selecting database
      $dbconn = pg_connect("***** port=*****
          dbname=***** user=***** password=*****")
          or die('Could not connect: ' . pg_last_error());    
  
      // Performing SQL query
      $query = 'SELECT * FROM enumbers';
      $result = pg_query($query) or die('Query failed: ' . pg_last_error());
  
      // Printing results in HTML
      echo "&lt;table&gt;\n";
      while ($line = pg_fetch_array($result, null, PGSQL_ASSOC)) {
          echo "\t&lt;tr&gt;\n";
          foreach ($line as $col_value) {
              echo "\t\t&lt;td&gt;$col_value&lt;/td&gt;\n";
          }
          echo "\t&lt;/tr&gt;\n";
      }
      echo "&lt;/table&gt;\n";
  ?&gt;
  </code></pre>