Use the IGNORE modifier of the INSERT statement:
$insert1=mysql_query("INSERT IGNORE INTO stylequiz_score(user_id,style_quiz_score,style_quiz_answer) VALUES('".$key."','".$arr1['style_quiz_score']."','".$arr1['style_quiz_answer']."')",$conn1);
If the row being inserted would get a duplicate key error, this modifier causes the insert to be skipped with no error.