You need read $stmt->error;
To read, you need rewrite code as in the example below.
...
$stmt = new mysqli_stmt($db);
if($stmt->prepare('SELECT name FROM table WHERE id = ? '))
{
$stmt->bind_param('i', $id);
$stmt->execute();
echo "Success
";
}
else {
var_dump($stmt->error);
}
...