Manca una tonda qui:

Codice PHP:
...
if(!
array_key_exists($row['indice'],$data)
... 

Un po' di iniziativa dai!