[eluser]Patrick Spence[/eluser]
Well, personally I wouldnt iterate over an array like that, I would use the foreach construct..
As for checking if they are all identical, you could set a flag variable to TRUE and keep track of the last piece of data through and compare to the current one, then switch it to FALSE if it is different..
But it is kinda klunky.
If you have control over the database, and want to prevent duplicates, you should consider using a unique flag on your id field.