title: How can i get all of my users from sql datebase with using php
body: <p>In <code>$result</code> should be all of users from datebase, but it takes only first person and shows error.</p>
  
  <p>My php code:</p>
  
  <pre class="lang-php prettyprint-override"><code>if ($_SERVER['REQUEST_METHOD'] == 'POST') {
      require_once 'connect.php';
  
      $response = mysqli_query($conn, "SELECT imie, nazwisko FROM users");
  
      $result = array();
      $result['osoby'] = array();
  
      $row = mysqli_fetch_assoc($response);
  
      $index['name'] = $row['imie'];
      $index['surname'] = $row['nazwisko'];
  
      array_push($result['osoby'], $index);
      $result['success'] = "1";
  
      echo json_encode($result);
  }
  </code></pre>