Mysql Database Error...

liunx

Guest
Good afternoon everyone.<br /><br />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. <br /><br />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.<br /><br />Is this a locking problem with mySQL? Or could someone tell me what is going on? I can provide details if needed. Thanks.<br /><br />Sarah<!--content-->
I don't think that there IS a locking function in MySQL like there would be for a datafile.<br /><br />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.<br /><br />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.<br /><br />Just a thought! <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" /><!--content-->
HC - <br />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.<!--content-->
 
Back
Top