By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,984 Members | 1,454 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,984 IT Pros & Developers. It's quick & easy.

Error in Query3Duplicate entry '' for key 'lastupdateipaddress'

P: 2
First am glad that there are people like you who really know stuff. im a newb in php but need some help here.

Error in Query3Duplicate entry '' for key 'lastupdateipaddress'

am trying to log on to the system with a different user name. how can i succeed? Thx
Mar 11 '13 #1
Share this Question
Share on Google+
3 Replies

Expert Mod 10K+
P: 12,349
It's hard to help without seeing the code that causes the error.
Mar 12 '13 #2

P: 2
Expand|Select|Wrap|Line Numbers
  1. $query3 = "insert into login_restriction (username, logintime, lastupdate, lastupdateipaddress, lastupdateusername, sessionid) value ('$username', '$updatedatetime', 
  2. $updatedatetime', '$ipaddress', '$username', '$sessionid')";
  3. $exec3 = mysql_query($query3) or die ("Error in Query3".mysql_error());
the system stores cookies of the last login session and ive tried disabling but in vain.
Mar 12 '13 #3

Expert Mod 100+
P: 2,324

Seems like you could have set the column lastupdateipaddress as a unique key. Which means you can only have one record like it in that column. If you have sessions from the same IP they won't insert, hence the duplicate entry message. That could be the main issue.

The most common datatype for IP address columns such as lastupdateipaddress is unsigned INT. You can add a regular index to the column, instead of unique key.

Hope that help.
Mar 12 '13 #4

Post your reply

Sign in to post your reply or Sign up for a free account.