How to ighore duplicates in mysql : I'm 'newbie' at MySQL, so i don't know how to correctly execute INSERT IGNORE in MySQL.

I'm developing a website with referral system that is linked to MySQL. I want to allow using same referral code for unlimited times, but now i'm always receiving an error "Failed to run query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'ref0001' for key 'referral'"

Also, please tell me where i have to put the INSERT IGNORE code. 

Thanks in advance, i will really appreciate your help <3
