468,514 Members | 1,585 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,514 developers. It's quick & easy.

Error in Query3Duplicate entry '127.0.0.1' for key 'lastupdateipaddress'

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 '127.0.0.1' 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
3 1473
Rabbit
12,513 Expert Mod 8TB
It's hard to help without seeing the code that causes the error.
Mar 12 '13 #2
Erizon
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());
  4.  
the system stores cookies of the last login session and ive tried disabling but in vain.
Mar 12 '13 #3
Niheel
2,425 Expert Mod 2GB
Erizon,

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.

Similar topics

8 posts views Thread by Paul Furman | last post: by
10 posts views Thread by DavidPr | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.