This topic is locked

E_USER_ERROR

1/23/2006 4:52:47 PM
PHPRunner General questions
S
seb author

Hello,

I get an error message when adding new content. Everything was fine last week but now....
Here's the error info:

Error type : 256

Error description: Duplicate entry '127' for key 1

URL : ................cgi-bin/php4.cgi

Error file : ..............dbconnection.php

Error line 26 .......(refers to the db_query($qstring,$conn) Function)

SQL query insert into `pics` (`pic`, `project`) values ('1.jpg', '15')
I have a project master table with information linked to a pics detail table for uploading multiple pictures related to a specific project. I made the master key an auto_increment ID field, and the Foreign key is the project name field from the master table.

I'm not sure the error resides in that relationship though, since the page that sends the error msg is dbconnection.
Anybody have an idea of where I should look to dubug this. I don<t know where to start looking.
thanks

Sergey Kornilov admin 1/24/2006

Hi,
it seems that you have an auto_increment-related error in your picstable.

Please try to run the following query on your database:

alter table cars set AUTO_INCREMENT=1001;



where 1001 is the largest pics.ID value increased by one.

S
seb author 1/24/2006

Thanks alot,

Actually this wasn't the problem but you put me on the right track.

I had my PICS table data type as TINYINT which alows a maximum of 127...
problem solved

thanks