title: returning an array in Mysqli prepared statement
body: <p>I have function in my database class that returns the <strong>id</strong> of the people that are from the a specific country such as spain. But for some reason I only get one value, but there are many people with the same country. here is the function:</p>
  
  <pre><code>Class DbAb {
  private $db;
  
  public function sameCountry($country) {
  
      $query = "SELECT id FROM users WHERE country = ? ";
      $stmt = $this-&gt;db-&gt;prepare($query);
      $stmt-&gt;bind_param("s",  $country);
      if ($stmt-&gt;execute()) {
  
          $stmt-&gt;bind_result($sameCountry);
          $stmt-&gt;fetch();
  
          return $sameCountry;
      }
      return false;
  }
  
  
  
  }
  
  $sameC = new DbAb();
  
  $samePeople = $sameC-&gt;samecountry("spain");
  
  print_r($samePeople);
  </code></pre>
  
  <p>Does anyone know how to return an array of results? I have tried to define the variable as an array but still doesn't work...</p>