I'm still having a bit of difficult implementing what you recommended. For a reason unknown to me, instead of incrementing the frequency by 1, it increments it by 2, when using the insert on duplicate syntax above.
Here is my show create table output, if it helps:
Code:
CREATE TABLE `ips` (
`userid` varchar(45) NOT NULL DEFAULT '0',
`ip` varchar(45) NOT NULL DEFAULT '0',
`ip_date` varchar(45) DEFAULT NULL,
`frequency` varchar(45) NOT NULL DEFAULT '1',
PRIMARY KEY (`userid`,`ip`),
UNIQUE KEY `userid_UNIQUE` (`userid`),
UNIQUE KEY `ip_UNIQUE` (`ip`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
Any thoughts on why this might be the case?
I am using the same code I posted above, modified for my new column names.
Bookmarks