Código PHP:
while ($fila2 = mysql_fetch_array($result2)) {
$tota = $fila2['a'];
$insert2 = "INSERT INTO totales(saldototabono) VALUES ('".$tota."') WHERE numtarjeta='".$numtar."' and nombre='".$nom."'";
$unaVar= mysql_query($insert2) or die ("Error en la consulta".mysql_error());
}
Prueba