sign in | join about | help | sitemap
Connecting Tech Pros Worldwide
Sean's Avatar

Storing re-usable data - shopping cart


Question posted by: Sean (Guest) on July 19th, 2005 06:36 AM
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


3 Answers Posted
Mosley's Avatar
Guest - n/a Posts
#2: Re: Storing re-usable data - shopping cart


"Sean" <NO_SPAM_TO_bullrout@optusnet.com.au> wrote in message
news:OcX7Xj0RDHA.2480@tk2msftngp13.phx.gbl...[color=blue]
> 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[/color]
"camera"[color=blue]
> section I need to display that heading as a link "camera", however in[/color]
order[color=blue]
> 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[/color]
a[color=blue]
> much better way of doing this, if there is can someone help me out with[/color]
some[color=blue]
> code?
>
> Sean
>
>
>
> SQL = "SELECT Catid,catDesc,ParentCatid FROM product_categories WHERE
> Catid=" &pCatId
> set rs = db_conn.execute(SQL)
>
> Application("CategoryName") = rs(1).Value
>
>[/color]

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.






Curt_C [MVP]'s Avatar
Guest - n/a Posts
#3: Re: Storing re-usable data - shopping cart

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_SPAM_TO_bullrout@optusnet.com.au> wrote in message
news:OcX7Xj0RDHA.2480@tk2msftngp13.phx.gbl...[color=blue]
> 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[/color]
"camera"[color=blue]
> section I need to display that heading as a link "camera", however in[/color]
order[color=blue]
> 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[/color]
a[color=blue]
> much better way of doing this, if there is can someone help me out with[/color]
some[color=blue]
> code?
>
> Sean
>
>
>
> SQL = "SELECT Catid,catDesc,ParentCatid FROM product_categories WHERE
> Catid=" &pCatId
> set rs = db_conn.execute(SQL)
>
> Application("CategoryName") = rs(1).Value
>
>[/color]


MN's Avatar
Guest - n/a Posts
#4: Re: Storing re-usable data - shopping cart

"Sean" <NO_SPAM_TO_bullrout@optusnet.com.au> wrote in message news:<OcX7Xj0RDHA.2480@tk2msftngp13.phx.gbl>...[color=blue]
> 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[/color]

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.
 
Not the answer you were looking for? Post your question . . .
196,996 members ready to help you find a solution.
Join Bytes.com

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 196,996 network members.
Post your question now . . .
It's fast and it's free

Popular Articles

Top Community Contributors