ci vuole una tabella temporanea dove raggruppare i risultati. Vediamo:

codice:
create temporary table temp
select taba.id, sum(tabb.paga) as tot
from taba, tabb
where tabb.riga = 1
and tabb.scelta = 1
and taba.id = tabb.relativo_id
group by tabb.relativo_id;


update taba, tabb, temp
set
taba.quota = taba.quota + temp.tot,
tabb.stato = 1
where
taba.id = tabb.relativo_id
and taba.id = temp.id
and tabb.riga = 1 
and tabb.scelta = 1;
prova cosi' che dovremmo esserci..... prima non avevo afferrato il discorso dei molteplici id. Mi ero fissato su uno solo...... LA query se la provi da phpmyadmin o altro tool deve essere nella stessa finestra di query.... come la variabile d'altronde. Verifica i nomi dei campi ...