Jump to content

Recommended Posts

Posted

Good afternoon everyone.

 

I made a content management system in PHP using a mySQL database. I have users that log in and view information based on which office they work at.

 

Well when users (including myself) access different pages, such as just viewing all the data in their table, an error keeps popping up on the screen. It says "error: duplicate entry '(number here)' for key 1". Now I know that there can't be a dup entry because they aren't even trying to update or add anything. And I've checked the db after these errors and nothing is affected. It's just annoying because people will be clicking on menu options to view or add data, and then they get this error. It only seems to happen when there are 2 or more users logged into the system.

 

Is this a locking problem with mySQL? Or could someone tell me what is going on? I can provide details if needed. Thanks.

 

Sarah

Posted

I don't think that there IS a locking function in MySQL like there would be for a datafile.

 

Is this custom code? It sounds like it might be. I would recommend that you cause the error and have it print out the SQL that you try to send to the MySQL database.

 

Sometimes, as sort of a cheat, if the SQL error is not immediately obvious, I'll copy the SQL to PHPmyAdmin to see what error code I would get executing it there.

 

Just a thought! :lol:

Posted

HC -

This is custom code that I wrote. I will try and ask the users to tell me what they did to get the error. It seems to happen often, but I can't exactly pinpoint what actually causes the problem.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...