How To Skip Insert If Same Name Exists In Table Without Error

hi i want to insert data in database using batchinsert

when user is creating then in backend i m inserting some default informtion ,but when i m again inserting other user it is again inserting same record and giving error of duplication,i want to just check if name exists in tables then skip the insert and check next record and insert,i dont want to update,just need to skip insert

What is the code you are using?

i m inserting records using batchinsert ,below is my code

when model is saving then i m calling function createaccount in model

like below

public function createAccount(){


       ['name','creation','modified','modified_by','owner','account_name','center_name'], [ 





wat whenever i m saving new account every time i m inserting defaults records using create function ,it is one time job i want to do only one times when one record save but i want to call every time but it is same records so when it is called it says duplication so i just want to skip insert if record exists,if name is already there then skips otherwise it will insert,but i dont want to update ,just insert records onece