lukerodham Posted May 7, 2011 Share Posted May 7, 2011 Hey guys just wondering if this piece of code is correct because i get a mysql error saying Duplicate entry '*********' for key 2 this is the code i have and table structure. $sql = " INSERT INTO `IP_Address` VALUES(NULL,'".$ip."','".$date."','".$time."') ON DUPLICATE KEY UPDATE `date` = `".$date."`, `time` = `".$time."` "; Link to comment https://forums.phpfreaks.com/topic/235778-on-duplicate-sql-query/ Share on other sites More sharing options...
fugix Posted May 7, 2011 Share Posted May 7, 2011 check this out for examples Link to comment https://forums.phpfreaks.com/topic/235778-on-duplicate-sql-query/#findComment-1211960 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.