title: Search bar not functioning properly
body: <p>My problem is when I enter a specific country name, for example: France, it'll output every data from my database instead of just France. I don't know where I've gone wrong and its probably something very simple but I don't even know how to attempt to fix it so I've come here to get some help</p>
  
  <pre><code>if ($_SERVER['REQUEST_METHOD'] == 'POST') {
      $country = $_POST['country'];
      $_SESSION['country'] = $country;
  
      $sqlQuery = "SELECT * FROM campsites WHERE country LIKE '%$country%'";
      $result = $campDataSet-&gt;fetchAllCamps($sqlQuery);
      //var_dump($result);
  
      if (count($result) &gt; 0) {
          echo'&lt;div class="table-responsive"&gt;
                  &lt;table class="table"&gt;
                      &lt;thead id="table1Head"&gt;
                      &lt;tr&gt;&lt;td&gt;Name&lt;/td&gt;
                          &lt;td&gt;Address&lt;/td&gt;
                          &lt;td&gt;Postcode&lt;/td&gt;
                          &lt;td&gt;Country&lt;/td&gt;
                          &lt;td&gt;Latitude&lt;/td&gt;
                          &lt;td&gt;Longitude&lt;/td&gt;
                          &lt;td&gt;email&lt;/td&gt;
                          &lt;td&gt;Phone&lt;td&gt;
                     &lt;/thead&gt;
                      &lt;tbody&gt;
  
              &lt;/div&gt;';
          foreach ($result as $row) {
              echo '&lt;tr&gt;&lt;td&gt;' . $row-&gt;campsite_name . '&lt;/td&gt; &lt;td&gt;' . $row-&gt;address . '&lt;/td&gt; &lt;td&gt;' . $row-&gt;postcode . '&lt;/td&gt; &lt;td&gt;' . $row-&gt;country. '&lt;/td&gt; &lt;td&gt;' . $row-&gt;lattitude . '&lt;/td&gt; &lt;td&gt;' . $row-&gt;longitude . '&lt;/td&gt; &lt;td&gt;' . $row-&gt;email . '&lt;/td&gt; &lt;td&gt;' . $row-&gt;phone_number . '&lt;/td&gt;&lt;/td&gt;&lt;/tr&gt;';
          }
          echo "&lt;/tbody&gt;&lt;/table&gt;";
      } else {
          print " 0 results";
      }
  }
  </code></pre>
  
  <p>my Database class</p>
  
  <pre><code>class campDataSet
  {
      public $dbHandle, $dbInstance;
  
      public function __construct()
      {
          $this-&gt;db = new campData();
          $this-&gt;conn = $this-&gt;db-&gt;getCampData();
      }
  
      public function fetchAllCamps()
      {
          //$sqlQuery = "SELECT campsites.id_campsite, campsites.campsite_name, campsites.address, campsites.postcode, campsites.country, campsites.lattitude, campsites.longitude, campsites.email, campsites.phone_number
          //         FROM sgb220_clientserver.campsites";
  
          $sqlQuery = "SELECT * FROM sgb220_clientserver.campsites";
  
          if ($data = $this-&gt;conn-&gt;prepare($sqlQuery)) {
              $data-&gt;execute();
              $dataSet = [];
              while ($row = $data-&gt;fetch()) {
                  $dataSet[] = new DBdata($row);
              }
  
          } else {
              echo "&lt;script&gt; alert(\"Could not prepare SQL statement\") &lt;/script&gt;";
          }
  
  
          return $dataSet;
      }
  </code></pre>