title: PHP mysqli - using result of DELETE
body: <p>I'm new to PHP and mysql, and I wonder if there is a way to use the result after a DELETE query.</p>
  
  <p>For example:</p>
  
  <pre><code>$stmt = $mysqli-&gt;prepare("DELETE FROM users WHERE id=?");
  $stmt-&gt;bind_param('i', $someID);
  $stmt-&gt;execute();
  //Here I want to use the name of the deleted user.
  </code></pre>
  
  <p>I know I can make a SELECT query before deleting, I just wonder if there is a smart way to get the deleted row. All I found so far is </p>
  
  <pre><code>$stmt-&gt;affected_rows
  </code></pre>
  
  <p>but that only gives the number of affected rows.</p>
  
  <p>Thanks</p>