Link to home
Start Free TrialLog in
Avatar of Graeme McGilvray
Graeme McGilvrayFlag for Australia

asked on

Dynamic ASP Classic Form Submit

Hi EE Team,


I am needing some help with a form submit in Classic ASP


http://b.gp.tours/?d=151 - This is the page doing the submission


The problem is the name of each <input type> is a number and it changes for each product/departure.

<input type=radio class=gross name=<%=ProdHero("dep_item_hero")%> value=<%=ProdOption("dep_item_ID")%>>

The reason why is that so a customer can select different option items within the each product, I need to use the 'hero item ID' to define that item type and its options.

In the example above, the Grandstand Ticket has a hero, and if you expand below are the options.


Please let me know if you have anymore questions, I will try the best I can.


TIA!



Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

i checked your page design, as long as your page is only load for a single Grand Prix, I would say it's safe to use a fixed name for your radio button elements.

In case the Prod Hero is important to you and need to be passed during form submission, you could save it as a hidden field for this purpose.

so something like this should work (for me):

hidden field for Prod Hero :

 <input type="hidden" name="ProdHero" value="<%=ProdHero("dep_item_hero")%>">

Open in new window


in your looping:

<input type=radio class=gross name="ProdOption" value="<%=ProdOption("dep_item_ID")%>">

Open in new window

Avatar of Graeme McGilvray

ASKER

Hi Ryan and thank you for helping out.

Unfortunately some products may include multiple of similar items, like 2 Hotels required at different parts of the trip (there is a couple which require overnight stays before going to final destination).

Under different Grand Prix's, there can be multiple ticket, hotel, transfer, flight options, and possibly multi of these.

What you you have proposed is what I had in my older website, which works if each product had the same layout (which unfortunately they now do not), I would like it to have a more dynamic hero/option list.

Thank you thou, your input is always great.
This is not really the best way to do this.

Think of it as either buying one product and adding multiple options, or buying multiple products.

Instead of numbers, use names like below where the value is the id of the product

<input type="radio" name="hotel" value="306">
<input type="radio" name="seat" value="152">
<input type="radio" name="race" value="451">

If you are not giving people options as to what seat and hotel, then you are selling packages. In this case, I have created another table called "packages" with an ID, Name and PackagePrice. Then another table called "package_details" with an ID, PackageID and ProductID.  Then you can add products to each package. If package 123 is shown, then create your query where package_details.PackageID = 123.  

The key is you want to use names that you can accept with variable values and not variable names.



Unfortunately some products may include multiple of similar items, like 2 Hotels required at different parts of the trip (there is a couple which require overnight stays before going to final destination). 

I'm thinking as long as dep_item_ID is uniquely defined, we should able to retrieve the Prod Hero ("dep_item_hero")  from the backend database, right? So technically we no need to pass Prod Hero ("dep_item_hero") in this case at all.
Hi Scott and thanks for your input.

I understand where you are coming from, however I need to have a dynamic name (hero item ID), not static (name).

As mentioned in the previous post to Ryan, it is required for the new website as there maybe multiple of the same type of item, so I would either have a conflict or unable to do a 2nd/3rd/more items that are the same.
One last option where I have used variable names was in building a custom form where the user was able to chose the field type, name, accepted values etc. That would be similar to what you are doing. In that case, it was like the package idea. I had a table of questions and answers. When that survey was selected, the survey id was submitted and on the back end I called up the survey table and it generated the asp to accept the variable fields and data. I did this 12 years ago and it is still in use. You can see the field names are similar to what you have http://languagelabtraining.com/survey.asp?survey=10080. But the difference is I have a database table that knows input name="409" is cross referenced with with a known field name.  I probably have this saved in my dropbox and I will see if I can dig up the code if it helps.
Hi Ryan, yes the 'dep_item_ID' is the unique identifier to that specific item chosen and will have a reference in the database to the 'dep_hero_ID'

However, if i have multiple hero's of the same item in the Product, how can i define that?

Reason why I ask this is... Something I want to build in the future is a multiple GP product, where they do 2 or 3 back-to-back(-to-back). so at least 3 hotel heros with options, 2 ticket heros with options, etc.
However, if i have multiple hero's of the same item in the Product, how can i define that? 

so.. does it mean, for example, ProdHero "305" is available for multiple Products (Grand Pixes)? or can you elaborate a bit further for this scenario?

sorry, may have lack of understanding to your requirements
 there maybe multiple of the same type of item,

You have to think of this as an invoice. You have an invoice header with the invoice id, customer id, and purchase date. Then you have another table of detail that would contain the invoice id and product id. Then a third table for payments that would contain a invoice id, payment type and payment amount at the most basic level.

For the invoice detail, you would end up with duplicate names like
<input name="product" value="213">
<input name="product" value="814">
<input name="product" value="329">
<input name="product" value="111">

On the page this gets posted to, you would look through request.form("product"). I believe it comes through as a csv. like product=213, product=814 etc. 
Thanks for that Scott, that particular format I am moving away from with my new website (as it was on my old - give a list and let them select). I found with the old format I had people looking at it, they got overwhelmed with information and choices (with everything laid out in front of them), lots of people scrolled up and down and then didn't click anything.

After getting alot of feedback from clients who (thankfully) emailed or called me, I always ask them about the website experience.

I want it this way (as I have displayed - hero with expandable), is so most of the work is done for them choosing initially.
I was not talking about the front end, how you have it displayed is fine.  What you are describing though sounds like my package idea.

In the end you are selling multiple products to one person. However  you have it displayed on the front end is separate from the fact you are submitting multiple products. You can have multiple field names duplicated like

<input name="product" value="213">
<input name="product" value="814">
<input name="product" value="329">
<input name="product" value="111"> 

instead of

<input name="213 " value="213">
<input name="814 " value="814">
<input name="329 " value="329">
<input name="111 " value="111"> 

On the back end you would know that product id 213 is a hotel and 814 is a seat and so on.  

In the end, I am just giving you an idea.
Hi Ryan, not an issue about explaining :)

For example in a multiple GP product
ID Item                 Hero/Option
1 Spa Camping   Hero
2 Spa Camping   Option
3 Spa Camping   Option
4 Spa Ticket        Hero
5 Spa Ticket        Option
6 Spa Ticket        Option
7 Spa to Ams Rail Hero
8 Ams Hotel         Hero
9 Ams Hotel         Option
10 Ams to Zanvoort rail Hero
11 Zandvoort Camping Hero
12 Zandvoort Camping Option
13 Zandvoort Camping Option
14 Zandvoort Ticket Hero
15 Zandvoort Ticket Option
16 Zandvoort Ticket Option

As you can see in this example there will be multiple heros of the same item (Hotels or Tickets or Rail)

Thats where i am unsure if giving a 'word name' to each type will work
Hi Scott, where you have 'instead of'
<input name="213 " value="213">
<input name="814 " value="814">
<input name="329 " value="329">
<input name="111 " value="111"> 

The name is the Hero ID of each item hero/option, the value is the unique ID of each item selected to be passed.

So If I have the above example, how can it be done?
One last comment, on your example page you have an id where d=390. And on the page there are no options for the user to select. This is what I am referring to with the package. On the back end you would know that package 390 contains products A, B and C. So if somebody is posting this form with their name and payment info, you don't need to know the specific products on this page, you just need to have the database insert those individual products by looking up d=390 and know what products to add. 

User generated image
Hi Scott, the options are in the 'Please click here to view alternative options / upgrades' expandable

Sorry to jump around, but this is the code to that survey link I pointed out.  You can see I am looping through the known questions for that particular survey and doing an insert. I would do this a lot different today, but it is very similar to what you are doing.  

   ' execute the insert
if problem="" then ' only go if no problem   


    Dim cmdSurvey


    Set cmdSurvey = Server.CreateObject ("ADODB.Command")
    cmdSurvey.ActiveConnection = MM_conLLT_STRING
    cmdSurvey.CommandText = "INSERT INTO dbo.llt_tSurvey_"&HomeFormID&" ("&theQ&") VALUES ("&theV&")"
    cmdSurvey.Prepared = true
do until rsQuestions.eof
    cmdSurvey.Parameters.Append cmdSurvey.CreateParameter("param1", 201, 1, rsQuestions.Fields.Item("MaxLength").Value, MM_iif(stripHtml(Request.Form(""&cstr(rsQuestions.Fields.Item("ID").Value)&"")),stripHtml(Request.Form(""&cstr(rsQuestions.Fields.Item("ID").Value)&"")) ,"")  ) 'Request.Form(rsQuestions.Fields.Item("ID").Value)
   
rsQuestions.movenext
Loop  

Open in new window

Hi Scott, sorry I have never seen code like this before, I am unsure what is going on here
My disconnect is I didn't immediately see that the ticket portion could expand.

Seeing this, does not change how I see this should be done. You have 4 products you are selling. 1) Tickets, 2) Hotel 3) Airport Transfer and 4) Transportation to the track.


Because you are using radio buttons, this suggests that there is one choice. How you physically display these things does not matter. In the end, you have choices for each type of product. And you are getting tripped up by using numbers for the field names.  The field names should be either "product" and the value remains. If you submit multiple fields with the same name, it just posts as a csv for class asp.

On the back end, you don't care that value of 305 is a ticket because you should have a table of products that has an id of 305 with a product type of "ticket". So that can be looked up.

Alternatively, you could name the group of tickets, "ticket"
<input type="radio" name="ticket" value="305" checked>
<input type="radio" name="ticket" value="306">
<input type="radio" name="ticket" value="307">
<input type="radio" name="ticket" value="308">
<input type="radio" name="transfer" value="309" checked>
<input type="radio" name="transfer" value="310">
<input type="radio" name="transfer" value="311">
<input type="radio"name="transfer" value="312">

Open in new window


In the example above, you will only get a 2 posted values, one for ticket and one for transfer. So you are just expecting

ticket = request.form("ticket")
transfer = request.form("transfer")

Open in new window

When you start using variable names like you are showing, it is going to get confusing. In the end, all you care about is the value of what is posted because you can look up what "303" is and find it is a ticket for section x.

The main point is to use real names that mean something and keep it consistent, not variable.

As far as what you are showing first or what you are calling the hero, that should be in your table to to use product id 303 as the hero for the specific category and then you can show it first and default the field to being checked. 
Hi Scott, what if I have multiple hotels stays, and/or multiple tickets for multi events in the same product? using hotel1, hotel2 isn't goi g to work as the possibilities are endless...

this is another reason why I want it to be dynamic and not static
what if I have multiple hotels stays, and/or multiple tickets for multi events 

Those are all products. You can add unlimited products.

You should have database tables for Product Categories, Products, Customers, Invoice Header and Invoice details.

When somebody makes a purchase, you start a new Invoice Header row that contains the date and customer id. Then add to the invoice details table using the invoice header id and product id. You can add as many products to the invoice details table as you want.  

In your products table, you can have many thousands of products. You may have 20 events. At each event you may have 100 hotels to choose from, 100 types of tickets, and so on.

The fact that you have to use variable field names like this means something is not set up correctly.

As example <input type="radio" class="gross" name="305" value="304">.  304 is probably the product ID.  The 305 looks like the product id for the first item or what you are calling the hero.  You can call it a number, that is fine, but name="305" is getting inserted to the invoice (or whatever you are naming the sale) as a product.  

You also have <input type="radio" class="gross" name="311" value="311" checked="">.  Same thing, the name="311" is really referring to the fact this is a product and the value is again probably the product id. All these name="some_number" is really name="product".  It would be easier to just use the name for what it is.

When you receive the post, the processing page looks for all the request.form("product") and inserts to your sales invoice. Trying to do this with a variable number for the field name is going to make things confusing.


OK, then how should I show each particular hero item and its options? Considering some products will have multi type of same item displayed (hotels, tickets, etc) in the input code?
Your back end asp can generate something like

sql = SELECT productID, productName FROM tblProducts WHERE productType ='ticket'

<input type="radio" name="ticket" value="305">ticket 1
<input type="radio" name="ticket" value="306">ticket 2
<input type="radio" name="ticket" value="307">ticket 3
<input type="radio" name="ticket" value="308">ticket 4

Open in new window


or

<input type="radio" name="product" value="305">ticket 1
<input type="radio" name="product" value="306">ticket 2
<input type="radio" name="product" value="307">ticket 3
<input type="radio" name="product" value="308">ticket 4

Open in new window


As far as styling or hiding child rows, you can use nth child https://developer.mozilla.org/en-US/docs/Web/CSS/:nth-child to set the first item as the hereo.  I don't know your db layout, but perhaps you have a field that designates the item as a hero.  Then your sql would be

sql = SELECT productID, productName FROM tblProducts WHERE productType ='ticket'  ORDERBY hero DESC

assuming that you have 0's or 1's for hero or not.  Or you could use a class like
<input type="radio" name="ticket" value="305">ticket 1
<input type="radio" class="hero" name="ticket" value="306">ticket 2
<input type="radio" name="ticket" value="307">ticket 3
<input type="radio" name="ticket" value="308">ticket 4

Open in new window

Then hide the rows where the class does not equal hero with CSS or javascript.

Hi Scott, currently I have a field called dep_hero_item which defines which hero each item sits under

So for the hero item, the dep_item_ID and dep_hero_item are the same
For each option, they are different, and the dep_hero_item refers back to the hero it should sit under as an option

So if/when I add 2nd sets of tickets/hotels for a second event, all tickets/hotels are not under the same hero
The "hero" only matter for displaying on the front end as to what goes first. All you care about is the product id.

Maybe post your table layout and a few rows of sample data. Include all tables related to products and sales.
Sorry, I must be missing something here...

The dep_hero_item is important to the code to show the options to the hero.
If it was just a generic word, then all items will be a choice, its Ticket or Hotel, not this ticket and that hotel.

I have just created a page and changed the name to a 'item' to show you what I mean
http://b.gp.tours/home-scott.asp?d=390

Yes, I need the item_ID to pull the data on the submit, but im not understanding how this works. 
Hey Graeme, I think we are saying the same thing. The dep_hero_item is important to show which item is the main item. This is only used for the front end though. When you submit the form, all you care about is the id of the product. I don't see, "dep_hero_item" in your html code so I assume that is in your database? 

It will be easier for me to understand what you are doing if I know the database table layout you have for products and sales. 
Here is my database

userdb - Copy.mdb

So this how it is layed out...

The Pages
categories
-products
--departures

The Items
dep_items
-items
--item_sub




The Page Code to show the items: (your edited page)
<%
        If CatID("cat_package")=TRUE Then
          Set ProdHero=oConnUSR.Execute("SELECT * FROM items,dep_items WHERE dep_items.item_ID=items.item_ID AND dep_items.dep_ID="&DepID&" AND dep_item_live=TRUE AND dep_item_hero=dep_item_ID ORDER BY dep_item_order")
        Else
          Set ProdHero=oConnUSR.Execute("SELECT * FROM dep_items WHERE dep_ID="&DepID&" AND dep_item_live=TRUE ORDER BY dep_item_total DESC")
        End If
        Do Until ProdHero.EOF
        ItemCat=ProdHero("dep_item_cat")
        If ProdHero("dep_item_hero")=ProdHero("dep_item_ID") Then
          ItemID=ProdHero("dep_item_ID")
          TitleType="Head"
%>
              <tr>
                <td width=100 height=80 rowspan=2 align=center valign=bottom><img height=75 src=<%=BrandDir%>/c-<%=ProdHero("item_type")%>.png></td>
                <td width=25 height=80 rowspan=2></td>
                <td height=60 colspan=12 valign=bottom><b3><%=ItemTitle(ItemCat)%></b3></td>
                <td width=50 height=80 align=right rowspan=2><input type=radio class=gross name=item value=<%=ProdHero("dep_item_ID")%> id=<%=ProdHero("dep_item_ID")%> checked></td>
              </tr>
<%
          TitleType="Sub"
%>
              <tr>
                <td width=25 height=30></td>
                <td height=30 colspan=11 valign=middle><b4><%=ItemTitle(ItemCat)%></b4></td>
              </tr>
<%
          Set ProdOption=oConnUSR.Execute("SELECT * FROM dep_items WHERE dep_item_live=TRUE AND dep_ID="&DepID&" AND dep_item_hero="&ProdHero("dep_item_ID")&" AND (NOT dep_item_hero=dep_item_ID) ORDER BY dep_item_cat")
          If NOT ProdOption.EOF Then
%>
              <tr class="parent" id=<%=ProdHero("dep_item_ID")%> style="cursor:pointer;">
                <td height=20></td>
                <td height=20 align=right><img src=<%=ImagesDir%>/s-dot.png height=20></td>
                <td colspan=16 height=20>&nbsp;<b5>Please click here to view alternative options / upgrades</b5></td>
              </tr>
<%
            ItemCat=0
            Do Until ProdOption.EOF
            ItemID=ProdOption("dep_item_ID")
            ItemCat=ProdOption("dep_item_cat")
            TitleType="OptionHead"
%>
              <tr class=child-<%=ProdHero("dep_item_ID")%> style="display:none;">
                <td width=100 height=30 align=center valign=bottom><img height=45 src=<%=BrandDir%>/c-<%=ProdOption("dep_item_cat")%>.png></td>
                <td width=25 height=30></td>
                <td height=30 colspan=12 valign=bottom><b4><%=ItemTitle(ItemCat)%></b4></td>
                <td width=50 height=50 align=right rowspan=2><input type=radio class=gross name=item value=<%=ProdOption("dep_item_ID")%> id=<%=ProdOption("dep_item_ID")%>></td>
              </tr>
<%
            TitleType="OptionSub"
%>
              <tr class=child-<%=ProdHero("dep_item_ID")%> style="display:none;">
                <td width=100 height=20></td>
                <td width=25 height=20></td>
                <td width=25 height=20></td>
                <td height=20 colspan=11 valign=middle><b5><%=ItemTitle(ItemCat)%></b5></td>
              </tr>
<%
            ProdOption.MoveNext
              Loop
          End If
        Else
          TitleType="Head"
%>
              <tr>
                <td width=100 height=30 align=center valign=bottom><img height=45 src=<%=BrandDir%>/c-<%=ProdHero("dep_item_cat")%>.png></td>
                <td width=25 height=30></td>
                <td height=30 colspan=10 valign=bottom><b4><%=ItemTitle(DepID)%></b4></td>
                <td width=25 height=30></td>
                <td width=50 height=50 align=right rowspan=2><%=ProdHero("dep_item_total")%></td>
                <td width=50 height=50 align=right rowspan=2>Add</td>
              </tr>
<%
          TitleType="Sub"
%>
              <tr>
                <td width=25 height=30></td>
                <td height=30 colspan=11 valign=middle><b5><%=ItemTitle(DepID)%></b5></td>
              </tr>
<%
          
        End If
        ProdHero.MoveNext
          Loop
%>


Open in new window

I just exported all of the tables to excel so I can view them at home on my  mac.  I will take a look a little later.
thanks Scott
On your last post with code, you have on line 7

  Do Until ProdHero.EOF 

Open in new window

What is the sql you are using for the recordset ProdHero?

Then on line 3
   Set ProdHero=oConnUSR.Execute("SELECT * FROM items,dep_items WHERE dep_items.item_ID=items.item_ID AND dep_items.dep_ID="&DepID&" AND dep_item_live=TRUE AND dep_item_hero=dep_item_ID ORDER BY dep_item_order") 

Open in new window

I don't see how you are joining the two tables items and dep_items without using criteria to keep it simple, I think I would expect something like

SELECT *
FROM items INNER JOIN dep_items ON items.item_ID = dep_items.item_ID
ORDER BY dep_items.dep_item_order;

Open in new window


In simplified terms, we need
SELECT dep_items.dep_item_hero, dep_items.item_ID
FROM dep_items
ORDER BY dep_items.dep_item_hero;

Open in new window

And that will get us groups to use in your items to show and hide.

User generated image
Hi Scott,

On your last post with code, you have on line 7

  Do Until ProdHero.EOF 

Open in new window


What is the sql you are using for the recordset ProdHero?

Then on line 3
   Set ProdHero=oConnUSR.Execute("SELECT * FROM items,dep_items WHERE dep_items.item_ID=items.item_ID AND dep_items.dep_ID="&DepID&" AND dep_item_live=TRUE AND dep_item_hero=dep_item_ID ORDER BY dep_item_order") 

Open in new window


Line 3 is the statement for line 7



I am not joining the tables items and dep_items as they are not the same information. dep_items refers to items.
dep_items lists the items available for that specific departure, whereas items is a list of all items available to choose from.

If I simplified it, then I would miss the other information required to display on page. date, price, nights, etc
That is going to be part of the problem. As example, run the below SQL and you will see you will just get the id's related to each other. You end up with 61,152 rows when one table had 392 rows and the other had 156. In other words, 392*156 = 61,152.

SELECT items.item_id, dep_items.dep_item_id
FROM items,dep_items;

Open in new window



What table are you using to track sales? I don't see it or am I missing something?
doc_rptObjects.txt


It looks like you do have some relationships set up in Access.


Table: categories                                                                                    Page: 1
Columns


         Name                                                  Type                        Size


         cat_ID                                                Long Integer                             4
         brand_ID                                              Short Text                             255


         added                                                 Date With Time                           8
         cons_ID                                               Long Integer                             4
         cat_name                                              Short Text                             255


         cat_live                                              Yes/No                                   1
         cat_social                                            Short Text                             255
         cat_package                                           Yes/No                                   1


         cat_other                                             Yes/No                                   1
         cat_description                                       Short Text                             255
         cat_event                                             Yes/No                                   1


         cat_contact                                           Yes/No                                   1
         cat_subtype                                           Yes/No                                   1
         cat_type                                              Yes/No                                   1


         cat_meals                                             Yes/No                                   1
         cat_type1                                             Long Integer                             4
         cat_disclaimer                                        Long Text                                -


         cat_comm                                              Long Integer                            






Table: dep_item_disc                                                                                 Page: 2
Columns


         Name                                                  Type                        Size


         disc_ID                                               Long Integer                             4
         added                                                 Date With Time                           8


         brand_ID                                              Short Text                             255
         cons_ID                                               Long Integer                             4
         dep_item_ID                                           Long Integer                             4


         disc_perc                                             Long Integer                             4
         disc_gross                                            Long Integer                             4
         disc_expire                                           Date With Time                           8


         disc_amount                                           Long Integer                             4
         disc_curr                                             Short Text                             255
         disc_live                                             Yes/No                                   1








Table: dep_item_tax                                                                                  Page: 3
Columns


         Name                                                  Type                        Size


         tax_ID                                                Long Integer                             4
         brand_ID                                              Short Text                             255


         added                                                 Date With Time                           8
         cons_ID                                               Long Integer                             4
         tax_live                                              Yes/No                                   1


         tax_name                                              Short Text                             255
         tax_perc                                              Long Integer                             4
         dep_item_ID                                           Long Integer                             4




Table: dep_items                                                                                     Page: 4
Columns


         Name                                                  Type                        Size


         dep_item_ID                                           Long Integer                             4
         brand_ID                                              Short Text                             255


         added                                                 Date With Time                           8
         cons_ID                                               Long Integer                             4
         dep_item_live                                         Yes/No                                   1


         dep_ID                                                Long Integer                             4
         item_ID                                               Long Integer                             4
         item_sub_ID                                           Long Integer                             4


         dep_item_hero                                         Long Integer                             4
         dep_item_cat                                          Long Integer                             4
         dep_item_nights                                       Long Integer                             4


         dep_item_night                                        Long Integer                             4
         dep_item_total                                        Long Integer                             4
         dep_item_curr                                         Short Text                             255


         dep_item_startdate                                    Date With Time                           8
         dep_item_mu                                           Long Integer                             4
         dep_item_comm                                         Long Integer                             4


         dep_pax                                               Long Integer                             4
         dep_item_name                                         Short Text                             255
         dep_item_order                                        Long Integer                             4


         dep_item_subname                                      Short Text                             255
         dep_item_soldout                                      Yes/No                                   1
         vendor_ID                                             Long Integer                             4


         dep_item_total_chd                                    Long Integer                             4
         dep_alloc                                             Long Integer                             4
         dep_instp                                             Yes/No                                   1




Relationships


         itemsdep_items


                              items                             dep_items


                    item_ID                             item_ID






                  Attributes:                Not Enforced, Right Join
                  RelationshipType:          One-To-Many




Table: departures                                                                                    Page: 5
Columns


         Name                                                  Type                        Size


         dep_ID                                                Long Integer                             4
         brand_ID                                              Short Text                             255


         added                                                 Date With Time                           8
         cons_ID                                               Long Integer                             4
         prod_ID                                               Long Integer                             4


         cat_ID                                                Long Integer                             4
         dep_live                                              Yes/No                                   1
         sub_cat_ID                                            Long Integer                             4


         dep_status                                            Long Integer                             4
         dep_conf                                              Yes/No                                   1
         dep_name                                              Short Text                             255


         dep_date                                              Date With Time                           8
         dep_nights                                            Long Integer                             4
         dep_social                                            Short Text                             255


         dep_social_short                                      Short Text                             255
         dep_social_shortb                                     Short Text                             255
         dep_sold                                              Yes/No                                   1


         dep_defaultpax                                        Long Integer                             4
         dep_promo                                             Yes/No                                   1
         dep_promo_hero                                        Yes/No                                   1


         vendor_ID                                             Long Integer                             4
         api_vendor                                            Long Integer                             4
         shadow_ID                                             Long Integer                             4


         api_ID                                                Long Integer                             4
         loc_ID                                                Short Text                             255






Relationships




         departuresitineraries


                           departures                          itineraries


                    dep_ID                              dep_ID






                  Attributes:                Not Enforced
                  RelationshipType:          One-To-Many






         productsdepartures


                            products                           departures


                    prod_ID                             prod_ID






                  Attributes:                Not Enforced
                  RelationshipType:          One-To-Many






Table: item_sub                                                                                      Page: 6
Columns


         Name                                                  Type                        Size


         item_sub_ID                                           Long Integer                             4
         brand_ID                                              Short Text                             255


         added                                                 Date With Time                           8
         cons_ID                                               Long Integer                             4
         item_sub_live                                         Yes/No                                   1


         item_ID                                               Long Integer                             4
         item_sub_name                                         Short Text                             255
         item_sub_description                                  Short Text                             255


         item_meals                                            Long Integer                             4




Table: items                                                                                         Page: 7
Columns


         Name                                                  Type                        Size


         item_ID                                               Long Integer                             4
         brand_ID                                              Short Text                             255


         cons_ID                                               Long Integer                             4
         item_live                                             Yes/No                                   1
         item_type                                             Long Integer                             4


         item_name                                             Short Text                             255
         item_description                                      Long Text                                -
         item_subname                                          Short Text                             255


         item_zone                                             Short Text                             255
         item_grade                                            Single                                   4
         added                                                 Date With Time                           8


         item_loc_fr                                           Short Text                             255
         item_loc_to                                           Short Text                             255
         vendor_ID                                             Long Integer                             4




Relationships


         itemsdep_items


                              items                             dep_items


                    item_ID                             item_ID






                  Attributes:                Not Enforced, Right Join
                  RelationshipType:          One-To-Many






Table: itineraries                                                                                   Page: 8
Columns


         Name                                                  Type                        Size


         itin_ID                                               Long Integer                             4
         brand_ID                                              Short Text                             255


         added                                                 Date With Time                           8
         cons_ID                                               Long Integer                             4
         dep_ID                                                Long Integer                             4


         prod_ID                                               Long Integer                             4
         itin_name                                             Short Text                             255
         itin_live                                             Yes/No                                   1


         itin_description                                      Long Text                                -
         itin_depdate                                          Date With Time                           8
         itin_arrdate                                          Date With Time                           8








Relationships


         departuresitineraries


                           departures                          itineraries


                    dep_ID                              dep_ID






                  Attributes:                Not Enforced
                  RelationshipType:          One-To-Many




Table: loc_info                                                                                      Page: 9
Columns


         Name                                                  Type                        Size


         Loc_Info_ID                                           Long Integer                             4
         brand_ID                                              Short Text                             255


         added                                                 Date With Time                           8
         cons_ID                                               Long Integer                             4
         loc_ID                                                Short Text                             255


         loc_title                                             Short Text                             255
         loc_info                                              Long Text                                -
         loc_order                                             Long Integer                             4


         loc_cat                                               Long Integer                             4
         loc_member                                            Yes/No                                   1






Table: locations                                                                                    Page: 10
Columns


         Name                                                  Type                        Size


         loc_ID                                                Short Text                             255
         brand_ID                                              Short Text                             255


         added                                                 Date With Time                           8
         cons_ID                                               Long Integer                             4
         location_live                                         Yes/No                                   1


         location_name                                         Short Text                             255
         location_country                                      Short Text                             255
         location_city                                         Short Text                             255


         loc_airport                                           Yes/No                                   1






Table: pax_exp                                                                                      Page: 11
Columns


         Name                                                  Type                        Size


         exp_ID                                                Long Integer                             4
         brand_ID                                              Short Text                             255


         cons_ID                                               Long Integer                             4
         added                                                 Date With Time                           8
         exp_live                                              Yes/No                                   1


         prod_ID                                               Long Integer                             4
         prod_plan                                             Long Integer                             4
         prod_next                                             Long Integer                             4




Table: products                                                                                     Page: 12
Columns


         Name                                                  Type                        Size


         prod_ID                                               Long Integer                             4
         brand_ID                                              Short Text                             255


         added                                                 Date With Time                           8
         cons_ID                                               Long Integer                             4
         prod_live                                             Yes/No                                   1


         prod_name                                             Short Text                             255
         prod_info                                             Long Text                                -
         prod_short                                            Short Text                               7


         prod_shortb                                           Short Text                               4
         cat_ID                                                Long Integer                             4
         prod_social                                           Short Text                             255


         loc_ID                                                Short Text                             255






Relationships




         productsdepartures


                            products                           departures


                    prod_ID                             prod_ID




                  Attributes:                Not Enforced


                  RelationshipType:          One-To-Many










Table: titles                                                                                       Page: 13
Columns


         Name                                                  Type                        Size


         title_ID                                              Long Integer                             4
         added                                                 Date With Time                           8


         brand_ID                                              Short Text                             255
         con_ID                                                Long Integer                             4
         title_live                                            Yes/No                                   1


         title_cat                                             Long Integer                             4
         title_type                                            Short Text                             255
         title_sub                                             Long Integer                             4


         title_head                                            Long Integer                             4
         title_summ                                            Long Integer                             4






Table: vendors                                                                                      Page: 14
Columns


         Name                                                  Type                        Size


         vendor_ID                                             Long Integer                             4
         added                                                 Date With Time                           8


         cons_ID                                               Long Integer                             4
         vendor_live                                           Yes/No                                   1
         brand_ID                                              Short Text                             255


         vendor_name                                           Short Text                             255
         vendor_loc                                            Short Text                             255
         vendor_sub_ID                                         Short Text                             255


         vendor_partner                                        Yes/No                                   1



Open in new window

I figured out that the "d" in the querystring http://b.gp.tours/?d=151 is referring to departures.

From that, how are each of the products (or whatever you are calling them) linked to d=151?

  • Malaysia Motorcycle grand prix
  • Fri- Sun F Grandstand Ticket
    • Option 2
    • Option 3
    • Option 4
  • Empress Hotel
  • Transfer from Airport
  • Bus to Sepang

Hi Scott,

Currently I am not putting the info into a table yet, I do have a separate Database that has customer details, sales information, however...Once I can get this first information pulling across, I will insert into this.

For your above post, if you look in dep_items, there is dep_ID which references the d=151, then that pulls the item_ID from items table.
This pulls up one item

SELECT dep_items.dep_item_ID, dep_items.item_ID, items.item_description, items.item_ID
FROM items RIGHT JOIN dep_items ON items.item_ID = dep_items.item_ID
WHERE (((dep_items.item_ID)=151));

Open in new window

For each of the 6 items here, what is the minimal SQL. In other words, I don't want SELECT * FROM table_name. Instead, SELECT field1, field2 FROM table_name  It would be at minimum the product id, description and price. TheSQL should relate to d=151
User generated image
Have you made any progress on this?
ASKER CERTIFIED SOLUTION
Avatar of Graeme McGilvray
Graeme McGilvray
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This is kind of what I suggested a bunch of comments ago. I am confused by what is taking place on line 4

   Request.Form(" "&EnqItems("dep_item_hero")&" ") 

Open in new window


I have quickly been through the previous comments, I don't see the suggestion

This is what works, it the dynamic selector for each hero product, instead of using names (which I wanted to stay away from)