there is a table with the following structure:
----------------------------- ID IP Timestamp ----------------------------- 1 127.0.0.1 1111111111 2 127.0.0.1 1111111112
You need to do the following: new entries should not be recorded in the table, whose IP
corresponds to the IP
in the table, and the Timestamp
in the table should be updated , otherwise a new entry is added with the new IP
----------------------------- ID IP Timestamp ----------------------------- 1 127.0.0.1 1111111112
I tried to set the индекс->unique
, but then the Timestamp
is not updated.
How to implement this business without sending 2 requests?