Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Inserting more than one entry into a MySql DB

by screamingeagle (Curate)
on Feb 01, 2002 at 19:15 UTC ( #142745=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://142745]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2023-12-04 10:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (25 votes). Check out past polls.

    Notices?