2
I have a PHP and Mysql script that searches the client table for all clients that have not yet been imported to another database/table and imports.
In the customer table, there’s a flag imported
with values (0 or 1).
I make a select on it and import to another table bank.
After that, in the same database that has the client table, has a table of logs where is inserted the email that was imported and the date.
Only sometimes it puts duplicate logs, as if it had mattered twice.
I don’t want it to occur the risk of importing or actually entering twice the same log.
You can ask, ah, just put the email field as single.
I can’t do that because my system sometimes inserts other types of logs with client email so it would give problem.
What better solution to this?
Have you thought about using composite primary key? Read about it and maybe for your project. Composite Primary Key
– Hugo Antunes
Post the structure of your log table.
– Marco Souza