Database question - Database question (Posted by momlil)
I have a database that is delimited with a :
I know how to pull the data out of the database and into an HTML page so people can verify their orders before placing them. There's only one thing I can't figure out.
If a person orders more than one item, all the information goes into one field separated by commas. So all the item numbers are together, all the descriptions, etc. My data base looks like this:
1234, 5678:cookbooks,poems:1,1: etc.
If I try to list each item in a table, it prints everything on one row instead of each item in its row. How do I get each item in its own row? Do I need to revise the way the information is saved to the database?
To see what I mean, go to www.theemailmarketer.com/books.html and place a "Test Order". Go through the whole process. The tables are fine on the cart and checkout pages because it is done with javascript. The order verification and receipt pages are what's messed up.
Any help would be appreciated.
Momlil
jwhitener posted this at 05:27 — 22nd November 1999.
They have: 27 posts
Joined: Mar 1999
I know that there is a better way to do this...but, the first thing that comes to mind is to make sure that your Name="" parts in your form have unique names between the "". If all your item numbers have Name="ordernum", then all the info is going to be stored to one field when submit is clicked. You can either have them order one thing at a time, or have Name="" values unique to each order.
(A better way: I'm pretty sure that cgi can split up/parse the incoming data if it's separated by a comma, but I don't know how to do this).
-j
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.