Use AJAX with JSON answer, that way you'll be able to redirect whenever you want without problem, and use objects from PHP to your JS flow:
You don't have to use js events on your DOM, only with your js you'll be able to achieve it, and it'll make your code more reusable, as it'll make it free from hardcoded variables:
index.html
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
</head>
<body>
<a class="clickable" href="update.php" id="1">update</a>
<script type="text/javascript">
$('.clickable').on('click', function(e) {
e.preventDefault();
var link = $(this);
var data = {
id: link.attr('id')
};
$.ajax({
type: 'POST',
url: link.attr('href'),
data: data,
dataType: 'json',
success: function(response) {
console.log(response);
if (response.result) {
console.log('All done!');
} else {
console.log('Something went wrong!');
}
if (response.redirect != 'undefined') {
window.location.href = response.redirect;
}
}
});
});
</script>
</body>
</html>
And then, in your PHP, you'll have to give back the answer as a JSON value, to get it:
update.php
<?php
include('connect.php');
$id = $_POST['id'];
$data = array();
if ( mysql_query ("UPDATE member SET number = '' WHERE id=$id") ) {
$data['result'] = true;
$data['redirect'] = 'http://example.com/redirect_to_ok_place';
} else {
$data['result'] = false;
$data['redirect'] = 'http://example.com/redirect_wrong_result';
}
echo json_encode($data); die();
?>
Note that your AJAX file must finish and echo your response if you want to get the values from PHP, and you MUST have a well formed json, so, if nothing is showed, check with console what values you're getting back, and if you echoed something previously.
To finish, it also important to point out that you MUST NOT USING MYSQL_QUERY PHP FUNCTIONS!! is deprecated, and it's a huge security hole. Use PDO or, if nothing else may be done, mysqli extension. Your code is ready for MySQL injection, so check for it here in SO to avoid it.