473,388 Members | 1,256 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Trouble with this shopping cart

Im having trouble adding more items to my shopping cart. It is supposed to be a very simple one because it is for my college assignment.

However i cant seem to make it work, im using the dictionary to add items to an array however it has now stopping even showing one item.

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <body>
  3. <%
  4. Dim id
  5. Dim conn
  6. Dim product
  7. Dim sql
  8. Dim Title
  9.          If Request.querystring("product_ID") Then
  10.  
  11.            id = Request.querystring("product_ID")
  12.  
  13.            set d=Server.CreateObject("Scripting.Dictionary")
  14.            Set conn=server.createobject("ADODB.Connection")
  15.            conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("20509703.mdb") 
  16.            Set product = Server.CreateObject("ADODB.Recordset")
  17.            sql="Select * from products where product_ID="&id
  18.            product.Open sql, conn
  19.            session("Title") = product("PName")
  20.            Title = session("Title")
  21.  
  22.             Do while id <> ""           
  23.            d.Add id, Title
  24.            Loop
  25.  
  26.       End If
  27.         Response.Write(d.Key)
  28.  
  29.       'remove all the items
  30.       d.RemoveAll
  31.  
  32.     'free up resources
  33.     set dt=nothing
  34. %>
  35. </body>
  36. </html
  37.  
Help would be appreciated
Jan 5 '07 #1
0 977

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Alex Hopson | last post by:
Hi, I'm trying to modify a shopping cart script from Mastering PHP/MySQL and am having trouble setting up some arrays for it. The original code, below, stores the cart items in a session...
1
by: madison | last post by:
Hi, I am trying to start a website using paypals shopping cart function. If i have 10 items and they sell out, how do I make it so the item is then listed as sold out. The next person would not...
5
by: Marshall Dudley | last post by:
I have a requirement where I need to insert a cart contents into all the pages of a website. There are two websites involved, the main website of the store owner, and the website of the shopping...
2
by: G.E.M.P | last post by:
High Level Session Handling Design for a Shopping cart 0) What am I missing? 1) How does OSCommerce do it? I'm thinking about building a shopping cart from scratch, using a library of dynamic...
6
by: frank | last post by:
can anyone point me to a free shopping-cart script?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.