La risposta è ajax. Un esempio.

Codice PHP:
<!DOCTYPE html>
<
html>
<
head>
<
title>Untitled</title>
<
script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> 
<script language="JavaScript" type="text/javascript">
<!--
function titi(oggetto) {
   var res    = Math.random();
   var src    = oggetto.src;
   var id     = oggetto.id;
   var param  = '&src='+src+'&id='+id+'&r='+res;
   $.ajax({
             url  : 'test9191b.php',
             type : 'POST',
             data : param, 
    dataType : 'html'
   }).done(function(html) {$('#risultato').html(html)}) ;
}
//-->
</script>
<meta http-equiv="pragma" content="no-cache" />
</head>
<body>
<img src="immagini/redwood.jpg" id="img01" onclick="titi(this);"/>
<div id="risultato">
</div>
</body>
</html> 
test9191b.php
Codice PHP:
<?php
$id  
$_POST['id'];
$src $_POST['src'];
// qui metti il codice per aggiornare i dati
print "Salvato : $id => $src";