Originariamente inviato da piero.mac
Quale? questa?

select id from $tabella where id= \"$id\" and anticipo =0";


ops... piccolo errore, non avevo visto

eccola quella giusta, ora funziona

$sql_anticipo = "select id, anticipo from $tabella where id= \"$id\"";