On Sep 10, 2004, at 7:33 AM, Tim Laureska wrote:

> So, is this a reverse of what you were saying (don't use structures for
>  the scenario I was describing) in that I could use a structure and
> break
>  it apart to insert data in individual rows using the code below ??
>
>  Tim
>
>

Not necessarily!

If you have a need for it, a structure can be very useful and
convenient.

Several shopping cart examples use a structure in the session scope to
store the items as they are added to the cart.

Then, when the user checks out, the program loops over the structure
and inserts them into the db.

One advantage to this approach is that items from abandoned carts don't
clutter the db (they are never inserted)

However, I prefer the approach where each item is inserted into the db
as it is added to the cart (regardless of whether you keep them in a
structure)

Two main advantages:

1) If a user is interrupted & the session is lost (system crash or
whatever) in the middle of a long order, with a structure approach, he
will have to reenter the entire order.  With items in the db, you can
design the cart to pick up where the user left off.

2) You have a record of abandoned carts that you can analyze.

But, in your case, if you can't justify a structure: don't use one

It seems a waste of time to loop thru the form, creating a structure --
just so you can loop thru the structure to insert into the db.

Dick
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to