fixed bug in checking for duplicate records. changes mysql_count_rows() for count() because  was an array.