//echo "<br><br><br><br><br><br>";
$id_record = reset(getVar("EV_id_record"));
echo "id_record".$id_record;
global $db;
    $sql = "select count(*) as contacts from (SELECT * FROM HFCS00_Kontakte_structure s where s.EV_id_record=".$id_record." and s.ENDIVx=1 group by s.SB090x_1) as base ;";
    $res = $db->SQLexecute($sql);
    $row = ($db->fetchAssoc($res));
//var_dump($row);
//echo "Anzahl vorherige Kontakte: ".$row["contacts"];
$aktKontakt = $row["contacts"]+1;
saveVar("SB090x_1=".$aktKontakt);