I'm new to PHP and mysql, and I wonder if there is a way to use the result after a DELETE query.
For example:
$stmt = $mysqli->prepare("DELETE FROM users WHERE id=?");
$stmt->bind_param('i', $someID);
$stmt->execute();
//Here I want to use the name of the deleted user.
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
$stmt->affected_rows
but that only gives the number of affected rows.
Thanks