1
My code takes information from the internet and inserts it into the database, however, it inserts the same information more than once a day.
I need to leave only 1 record information per day, IE, each day that the program runs, it will enter only 1 time the record in BD.
Example:
data | seller_id |
'2017-03-14' | 12345678 |
'2017-03-15' | 12345678 |
The problem of creating a key on the date is that more than one id will be entered per day, so I can’t put date as a key. But I can’t put the id either, because each day a new die of that same id will be added. The table would be with various ids and dates: date | seller_id | '2017-03-14' | 12345678 | '2017-03-15' | 12345678 | '2017-03-14' | 87654321 | '2017-03-15' | 87654321 |
– João Gabriel F. Marins
I spoke of a UNIQUE KEY composed by (date | seller_id) if it is not this did not understand the problem , I’m sorry.
– Motta
Ah yes, now I understand Motta. You’re right! Thanks for the force, I’ll try here
– João Gabriel F. Marins