搜索大量的字符串php和mysql

I hope this is correct way to ask question.

I am doing some custom development in php(Magento) and I have one requirement to collect all the string from my files and save on my custom table. As of now I created one button(Kind of refresh to get all of the strings) this collect all of the string and save in my custom tables. When I clicked on first time then it found more then 15K string and save in my custom tables which is correct. But whenever I am trying to click on Refresh button I need to avoid duplicate the string in my custom table.

So my question is how can I avoid string comparison(I am using "avoid" word because this number might be increase it can be 20K in future) for each to avoid duplicate or can I add UNIQUE Constraint in my table ? Which one is correct way or any expert suggestion?

EDIT

I want to avoid duplicate entry in my table. For example, when I click on "Refresh" button at that It found the 5 entry and it save in my custom table,

table

id       some_column                         
1         (Excl. Tax)             
2         (Incl. Tax)             
3         Target Rule/Product             
4         File %1 does not exist             
5         hello             
...

now whenever I am clicking " Refresh" button at that I can find the same entry but I don't want to add this entry in table as it is duplicate.