Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Who can I do this?

Explorer ,
Dec 31, 2012 Dec 31, 2012

Copy link to clipboard

Copied

Ok I am helping a friend with a website for a local ski shop to sell online. I have done dynamic sites before and have managed to figure things out most of the time by searching....but I am really butting my head against the wall. Here is what I need to do.(I am using .ASP and Access DB)


On the admin side he will be able to input new inventory such as skis. Every brand of skis has different lengths, If I create a multi-choice drop menu and insert that into the DB it gives me the following in one field in the DB...skiLength: 160 cm, 161 cm, 162 cm, 163 cm


Ok so how do I display that on the front end so it will allow shoppers to select from an individual length values that are available. I can only get it to return like this, when I query the DB. How can I split this into individual sli lengths?

Ski Lengths: 160 cm, 161 cm, 162 cm, 163 cm

In the DB the fields looks like this

Capture.PNG

I know that I can do this if I added individual fields for each length, but there has to be an easier way with ASP code


Check this link to see what I am talking about on a front side. It lists the sizes that are available and allows it to be passed on to a cart as a unique value


Elan Amphibio Waveflex 78 Ti Skis with ELX 11.0 Fusion Bindings 2013


thanks for the help..


theDogger

TOPICS
Server side applications

Views

876
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 31, 2012 Dec 31, 2012

Copy link to clipboard

Copied

>I know that I can do this if I added individual fields for each

>length, but there has to be an easier way with ASP code

You wouldn't want to do that, but your current database design is not correct. Currently you have more than one value in a field (skiLength) which is a basic normalization violation. You just need to include one length in the field and have separate rows for each combination, or create a separate table for that.

What is the basic workflow a user would use to select skis?

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 31, 2012 Dec 31, 2012

Copy link to clipboard

Copied

Thanks for the help....but to add to it...as you stated..."You wouldn't want to do that, but your current database design is not correct. Currently you have more than one value in a field (skiLength) which is a basic normalization violation."

I understand that, that was a result of trying to use a multi-select menu. When submitted it puts it all into the one field. Are you suggesting that I have 40 field for ski lengths that range from 155-220?

I know with ASP that you can take a field from a DB and do a either a SPLIT or ARRAY or maybe both together with the data from a single field that is common delimited.

or

Are you suggesting a reference table? Still every ski added has a different number of lengths.

Check out the link above to the ski site that has the individual lengths that each have their own valve when selected to added to the cart.

How would you structure the DB then? maybe seeing it will make the light go off!!!!

theDogger

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 01, 2013 Jan 01, 2013

Copy link to clipboard

Copied

Ok got the DB figured out. I added a reference table for the skiLength like this

Capture.PNG

Capture.PNG

Now I believe that I need to creat a new table that will hold this info. so I can pass it on to the PayPal cart. Any thoughts?

theDogger

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 01, 2013 Jan 01, 2013

Copy link to clipboard

Copied

LATEST

>Now I believe that I need to creat a new table that will hold this info.

>so I can pass it on to the PayPal cart. Any thoughts?

Yes, this is a much better model.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 01, 2013 Jan 01, 2013

Copy link to clipboard

Copied

>Are you suggesting that I have 40 field for ski lengths that range from 155-220?

No; that would be a case of repeating fields which should always be avoided.

>Are you suggesting a reference table? Still every ski added has a different number of lengths.

Yes, with a reference table and an association (junction) table . You have done this in your later post, with the table that links the SkiID to the skiLength.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines