470,863 Members | 1,470 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Error in Query3Duplicate entry '' for key 'lastupdateipaddress'

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
3 1522
12,516 Expert Mod 8TB
It's hard to help without seeing the code that causes the error.
Mar 12 '13 #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
2,449 Expert Mod 2GB

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
By using this site, you agree to our Privacy Policy and Terms of Use.