List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:July 31 2000 6:03am
Subject:Re: Unable to insert records after inserting 10 records....
View as plain text  
At 10:54 AM +0530 2000-07-31, Vinod wrote:
>Hi,
>Sorry to trouble u again.
>I am trying to insert data thro' PHP into a MySql Table whose data 
>structure is appended below:
>
>CREATE TABLE abc(
>   Offer_id varchar(10) DEFAULT '' NOT NULL auto_increment,
>   update_dt timestamp(14),
>   post_dt timestamp(14),
>   Email varchar(20),
>   Comp_Name varchar(30),
>   Category varchar(25),
>   Industry varchar(75),
>   Offer_Title varchar(40),
>   Offer_Desc text,
>   Validity varchar(10),
>   Homepage varchar(20),
>   Password varchar(10),
>   uflag enum('Updated','Not Updated'),
>   PRIMARY KEY (Offer_id)
>);
>
>The problem is that after I insert record no.10,Mysql gives me an 
>error  as below.
>ERROR 1062: Duplicate entry '10' for key 1.
>
>This prevents me from inserting further records.Please let me know 
>as to where i have gone wrong?
>
>Thanx and best regards,
>Vinod

This is very likely due to the fact that you've made your AUTO_INCREMENT
column a VARCHAR type, when AUTO_INCREMENT can be used only for integer
columns.  There is probably some sort of type conversion going on that
results in your trying to insert a record with an Offer_id value that
duplicates a value already present in the table.

-- 
Paul DuBois, paul@stripped
Thread
Unable to insert records after inserting 10 records....Vinod31 Jul
  • Re: Unable to insert records after inserting 10 records....Jeremy D. Zawodny31 Jul
  • Re: Unable to insert records after inserting 10 records....Paul DuBois31 Jul