I would like to know if there is a way to check if a row exists in the db, I'm working with an API and I'll be adding a script who will run every 24 hours to collect data from a page which has data from many companies, but if I run the script today and tomorrow for example there's a chance of gather almost the same data with new ones so I need to get rid of those, is a good idea to use COUNT or should I use if statements?
I'm adding this json data to my db:
{
OrgName: name,
Direction: Street 123
City: cityname
Lat: 13.123123
Lon: 12.123123
Code: XC23-123D
}
As mentioned before, the data can be repeated in all the keys but not in the code, will code=unique solve the problem?