conditional sql statements

B

Bill

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
 
R

Ray at

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top