title: How to delete selected user? PDO
body: <p>I am using PDO and I want to remove specified user from my members list. I made "delete" button to show on every single user, and I want when I click on any random user, to delete him. This is my second day trying to make that.</p>
  
  <p>I made something like this:</p>
  
  <pre><code>$id = $user-&gt;id;
  $sql = "DELETE FROM `users` WHERE `id` = :id";
  $query = $handler-&gt;prepare($sql);
  $query-&gt;execute(array(":id" =&gt; $id));
  </code></pre>
  
  <p>But this is not a solution, this will delete everyone why join that page. I want to make when i click "delete" button, to remove the user where that button was. I hope you understand me, I'll show you the picture how I want it to be.</p>
  
  <p><a href="https://i.stack.imgur.com/9ZTLZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9ZTLZ.png" alt="enter image description here"></a></p>