I have such error if i have system shutdown or network problem. You really don't av a duplicate in your db. DAT is mysql db error...all you need to do is dat, if u do ur insertion and it is not true, jes alter one of d column of ur table you want to insert into either from varchar to text or bigint and den redo the insertion. Dat solve d problem.
If(!$insert){
$alter=Mysql_query("alter table table_name
change table_name
table_name
bigint(255) not null");
If($alter){
//you then redo your insertion.
}
}