473,386 Members | 1,830 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,386 software developers and data experts.

Storing re-usable data - shopping cart

HI,

I have a shopping cart in which I am trying to use breadcrumb style
navgiation. I need to be able to display the categroy heading relating to
the section of the site a visitor is using i.e If a user is in the "camera"
section I need to display that heading as a link "camera", however in order
to do this at the moment I am querying the database and storing the
recordset in the application object (see below). I should imaging there is a
much better way of doing this, if there is can someone help me out with some
code?

Sean

SQL = "SELECT Catid,catDesc,ParentCatid FROM product_categories WHERE
Catid=" &pCatId
set rs = db_conn.execute(SQL)

Application("CategoryName") = rs(1).Value
Jul 19 '05 #1
3 1750

"Sean" <NO*****************@optusnet.com.au> wrote in message
news:Oc**************@tk2msftngp13.phx.gbl...
HI,

I have a shopping cart in which I am trying to use breadcrumb style
navgiation. I need to be able to display the categroy heading relating to
the section of the site a visitor is using i.e If a user is in the "camera" section I need to display that heading as a link "camera", however in order to do this at the moment I am querying the database and storing the
recordset in the application object (see below). I should imaging there is a much better way of doing this, if there is can someone help me out with some code?

Sean

SQL = "SELECT Catid,catDesc,ParentCatid FROM product_categories WHERE
Catid=" &pCatId
set rs = db_conn.execute(SQL)

Application("CategoryName") = rs(1).Value


Im not sure what your aim is,

but

A Application("CategoryName") variable is the same for all users, so if one
user changes the variable from 'camera' to 'film', the value will change for
all users no mater if they are in the camera or film or what ever section.
this value stays till changed or site is restated.
For example, if you were running a action, you would want the latest bid to
be seen bid to be seen by all users
to avoid the chance that 2 users may use the variable at the same time, use
Application.Lock and Application.Unlock when you change a Application
variable

A Session("CategoryName") variable is for the user only, and lasts as long
as the session, if you close the browser you lose the values. You can leave
the page as long as you come back before the session times out default is 20
minutes

a normal DIM CategoryName variable loses its value as to leave the page.


Jul 19 '05 #2
pass it as a hidden FORM variable, or in the QueryString

--
----------------------------------------------------------
Curt Christianson (Software_AT_Darkfalz.Com)
Owner/Lead Designer, DF-Software
http://www.Darkfalz.com
---------------------------------------------------------
...Offering free scripts & code snippits for everyone...
---------------------------------------------------------

"Sean" <NO*****************@optusnet.com.au> wrote in message
news:Oc**************@tk2msftngp13.phx.gbl...
HI,

I have a shopping cart in which I am trying to use breadcrumb style
navgiation. I need to be able to display the categroy heading relating to
the section of the site a visitor is using i.e If a user is in the "camera" section I need to display that heading as a link "camera", however in order to do this at the moment I am querying the database and storing the
recordset in the application object (see below). I should imaging there is a much better way of doing this, if there is can someone help me out with some code?

Sean

SQL = "SELECT Catid,catDesc,ParentCatid FROM product_categories WHERE
Catid=" &pCatId
set rs = db_conn.execute(SQL)

Application("CategoryName") = rs(1).Value

Jul 19 '05 #3
MN
"Sean" <NO*****************@optusnet.com.au> wrote in message news:<Oc**************@tk2msftngp13.phx.gbl>...
HI,

I have a shopping cart in which I am trying to use breadcrumb style
navgiation. I need to be able to display the categroy heading relating to
the section of the site a visitor is using i.e If a user is in the "camera"
section I need to display that heading as a link "camera", however in order
to do this at the moment I am querying the database and storing the
recordset in the application object (see below). I should imaging there is a
much better way of doing this, if there is can someone help me out with some
code?

Sean

SQL = "SELECT Catid,catDesc,ParentCatid FROM product_categories WHERE
Catid=" &pCatId
set rs = db_conn.execute(SQL)

Application("CategoryName") = rs(1).Value


As another poster has suggested, use the session object to maintain
state throughout the user's visit. I would suggest replacing your
in-line SQL with a call to a stored procedure, as it stands your code
could be open to a SQL injection attack.
Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mark | last post by:
I have a website with an increasing amount of articles and news reports and so I am thinking of moving away from storing each article as a seperate page to having a single page and storing articles...
2
by: Tony | last post by:
Hi, I have dynamically created a PDF document in memory as a FileOutputStream Now I have to get it into a DB2 table, storing it as a BLOB. The table has a document id, document name, some date...
1
by: Kay | last post by:
A linked list is storing several names. I want to make a queue if I input a name that is same as the linked list. How to make each node of a linked list storing a queue that are different with each...
6
by: Alfonso Morra | last post by:
I have written the following code, to test the concept of storing objects in a vector. I encounter two run time errors: 1). myClass gets destructed when pushed onto the vector 2). Prog throws a...
12
by: Alfonso Morra | last post by:
I have the ff code for testing the concept of storing objects: #include <vector> #include <iostream> using namespace std ; class MyClass { public: MyClass(){
5
by: Don Vaillancourt | last post by:
I'm building a system when one can upload a document to the website. I will be storing the document on the hard-drive for quick/easy access, but I was also thinking of storing it in an existing...
2
by: Kay | last post by:
A linked list is storing several names. I want to make a queue if I input a name that is same as the linked list. How to make each node of a linked list storing a queue that are different with each...
6
by: Kieran Benton | last post by:
Hi, I have quite a lot of metadata in a WinForms app that I'm currently storing within a hashtable, which is fine as long as I know the unique ID of the track (Im storing info on media files). Up...
7
by: fauxanadu | last post by:
Is it possible to store dates before 01/01/0100 A.D. (such as for as database storing world events would require) using MS Access? Verbose Explination I need to be able to store dates before...
1
by: Jonathan Wood | last post by:
My site includes a feature that allows users to upload an image. (Never more than one image per user.) I've been considering storing these uploaded images as a file on the server with a filename...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.