Codice PHP:
if (($_GET[action2] == 'edit') && ($_GET[id] == $id[$i])) {?> 

La variabile $i dove viene inizializzata?