in reply to Inserting more than one entry into a MySql DB

I see that the Order number is staying the same for each iteration... if the order num column is the primary key in the table, then it is logical that only the first insert will work, and all the others will fail, because the primary key will have a UNIQUE constraint by default which will prevent it from having duplicate values. You need to generate a new value for the primary key for each insert statement
  • Comment on Re: Inserting more than one entry into a MySql DB

Replies are listed 'Best First'.
Re: Re: Inserting more than one entry into a MySql DB
by Kiko (Scribe) on Feb 01, 2002 at 19:48 UTC
    Hi,
    You were right, i changed the primary field to something else and it worked. I was focusing on the script and didn't realize that the problem was in the way i set up the database.
    Thanks for your help
    -Kiko