Because you are using an <a>
tag, you need to stop the default execution of such a link. The easiest would be:
onclick="updateDB(...); return false;"
That being said, since you already use jQuery, do yourself a favor and use jQuery's event handlers, e.g:
<a href="#" id="testlink">Test</a>
<script>
$('#testlink').click(function(event){
event.preventDefault();
updateDB('<?php echo $a; ?>','<?php echo $b; ?>','<?php echo $c; ?>','<?php echo $d; ?>','<?php echo $e; ?>','<?php echo $f; ?>','<?php echo $g; ?>','<?php echo $h; ?>','<?php echo $i; ?>','<?php echo $j; ?>','<?php echo $k; ?>');
});
</script>
Even better would be to attach the variables you get from PHP and add them to a data-
attribute, so you can reuse the click handler:
<a href="#" class="testlink" data-my-value="1">Test 1</a>
<a href="#" class="testlink" data-my-value="2">Test 2</a>
<script>
$('.testlink').click(function(event){
event.preventDefault();
var data = $(this).attr('data-my-value');
updateDB(data);
});
</script>
UPDATE: To still redirect to another page, I would do this (untested):
<a href="newpage.html" class="testlink" data-my-value="1">Test 1</a>
<script>
$('.testlink').click(function(event){
event.preventDefault();
var data = $(this).attr('data-my-value'),
url = $(this).attr('href');
updateDB(data, url);
});
function updateDB(data, url)
{
$.post("update.php",
data,
function() {
window.location = url;
}
);
}
</script>