Gude,
Probiers doch nochmal hiermit:
$var = array("wert" => array(),
"uid" => array()
);
$i = 1;
$result = mysql_query("SELECT * FROM $tabellenName ORDER BY UmfrageNr
ASC");
while ($myrow = mysql_fetch_row($result)) {
$var['wert'][$i] = $myrow['Ja'];
$var['uid'][$i] = $myrow['UmfrageNr'];
$i++;
}
$i = 1;
$result = mysql_query("SELECT * FROM $tabellenName2 ORDER BY UmfrageNr
ASC");
while ($myrow = mysql_fetch_row($result)) {
$var['wert'][$i] = $var['wert'][$i]+$myrow['Ja'];
$i++;
}
for($j=1; $j<$i; $j++) {
mysql_query("UPDATE $tabellenName2
SET Ja
= ".$var['wert'][$j]." WHERE UmfrageNr = ".$var['uid'][$j]);
}