|P is for Practical|
DBI SQL statement in while loopby peppiv (Curate)
|on Dec 03, 2002 at 20:58 UTC||Need Help??|
peppiv has asked for the
wisdom of the Perl Monks concerning the following question:
Here's something I haven't been able to figure out (but have to, urgently).
I have this e-commerce package on our site and since I'm running the CC verification through a socket program I wrote, I also want to send this information to a DB for reporting purposes (the commerce package sucks, but alas, I don't get to make purchasing recs).
Here's the problem: The commerce program sends me transaction details through a form. Their form sends (1) transaction info - name, time, etc. (2) and transaction details - quantity 1 of product B, quantity 2 of product C, etc. Their form iterates through the transaction details, if there's more than one item per transaction, and sends the data to my program. The data is sent through set variables but as the program iterates over to the next item, it sends the info again to the same variables. Hence, if I do a single DBI INSERT I'm only collecting info on the Last item.
I thought that using a while loop might solve this problem but I'm not sure if it's the right thing to do or I've just totally screwed it up :0
inoperative code to follow
I get no errors. I just know that I'm not passing any data to this table (I pass other data to another table earlier in the program so I'm sure the DB connection works). Can I accept variables passed through a form to this script in a while statement?
Any suggestions or quick pointers to where I'm falling down would be appreciated.
Supa Thanx, for any help