sql - duplicates
- by Sebastjan
Hey guys
I'm putting data from website (json) to sql base.
In db i have these rows.
ID | PostId | Name | Message
Id is auto-increment primary key.
PostId also has a unique values.
Name and Message are nothing special.
When I run my script / click on the button in form / ... , the program saves all the values into database (lets say there are 25).
Next time I'm going to press the button there will be added 25 more records (all duplicates), and so on...
Is there a way that the program can check through 'PostIds' if the value already exists before adding it to the db?
Thanks