View Single Post
Old 10-07-2002, 01:29 PM   PM User | #2
raf
Master Coder


 
Join Date: Jul 2002
Posts: 6,589
Thanks: 0
Thanked 0 Times in 0 Posts
raf will become famous soon enoughraf will become famous soon enough
i'm not sure i completely undersand your problem.

i think it comes down to this : you want to store some data (an ID for the selected albums) somewhere, without writing it to a database + you want to retrieve the ID and use them as selectioncriteria to build the checkoutpage.

How to do it depends on your app, the used language, servercapacity, etc.

I use a lot of ASP lately, and I would store the ID's in session-variables.

How ?
- create/modify your global.asa (each time a user starts the application, a session for this user is created and space is reserved for the session-variables. )
- create/modify your session_on start sub like this
Sub Session_OnStart

session("albumID")=0

-when an album is selected, post the form to an ASP page where you store the ID in the sessionvariables like this

session("albumID")=request.form("albumID")

- to retrieve the ifno and use it in a selectquery:

sql="SELECT albumName artistName etc FROM tables WHERE albumID = anID"
sql=replace(sql,"anID",session("albumID")


If the user needs to be aible to order more then one album, you can use a string variable and create a 'comma separated string' by adding the ID's each time an album was chosen (+ create an array with it and then use a loop for the select-querys)

Or you could use multiple session-variables (ad them to the global.asa)

session("numberordered")=0
session("albumID1")=0
session("albumID2")=0
session("albumID3")=0
session("albumID4")=0
session("albumID5")=0
session("albumID6")=0

and store each ID in a new variable + keep track of the numer of albums ordered (to know witch session-variable to use to write the next album ID. probably best with a "select case" structure.)

Does this makes any sense to you ?
raf is offline   Reply With Quote