I have a shopping cart that I want to load items in that come from a
huge scrolling form. In other words, when someone clicks on a category
in our site, it scrolls out all the items in that category, maybe 30
or more. I have text boxes next to each item so somone can enter a
number, then press submit form button at the bottom of the form, and
send those slections to the shopping cart.

The problem is, many of the text boxes are empty, yet they are still
being sent to the shopping cart as a quatity of 0. Is there a way for
sql to ignore a value if the variable is zero, or only get the sql
statement to run if a variable is > 0?

Thanks,

Bill

Re: conditional sql statements by Ray

Ray
Fri Aug 29 14:21:14 CDT 2003

Post your code. [empty] <> 0 unless you cint() it, or unless in your DB,
you have a default value of 0. I don't know how your building your query,
but it sounds like you may want to change it so that it only inserts values
for columns that values were sent for from your form.

Ray at work

"Bill" <billzimmerman@gospellight.com> wrote in message
news:8da5f4f4.0308291041.251d621e@posting.google.com...
> I have a shopping cart that I want to load items in that come from a
> huge scrolling form. In other words, when someone clicks on a category
> in our site, it scrolls out all the items in that category, maybe 30
> or more. I have text boxes next to each item so somone can enter a
> number, then press submit form button at the bottom of the form, and
> send those slections to the shopping cart.
>
> The problem is, many of the text boxes are empty, yet they are still
> being sent to the shopping cart as a quatity of 0. Is there a way for
> sql to ignore a value if the variable is zero, or only get the sql
> statement to run if a variable is > 0?
>
> Thanks,
>
> Bill



Re: conditional sql statements by Mike

Mike
Fri Aug 29 14:51:01 CDT 2003

I would recommend checking the fields in the submitted form for "" (or "0"),
and construct a sql query on the fly that you call at the end.

"Bill" <billzimmerman@gospellight.com> wrote in message
news:8da5f4f4.0308291041.251d621e@posting.google.com...
> I have a shopping cart that I want to load items in that come from a
> huge scrolling form. In other words, when someone clicks on a category
> in our site, it scrolls out all the items in that category, maybe 30
> or more. I have text boxes next to each item so somone can enter a
> number, then press submit form button at the bottom of the form, and
> send those slections to the shopping cart.
>
> The problem is, many of the text boxes are empty, yet they are still
> being sent to the shopping cart as a quatity of 0. Is there a way for
> sql to ignore a value if the variable is zero, or only get the sql
> statement to run if a variable is > 0?
>
> Thanks,
>
> Bill