mysqli_stmt_close closes $stmt instead of unspecified variable $query