473,789 Members | 2,774 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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,P arentCatid FROM product_categor ies WHERE
Catid=" &pCatId
set rs = db_conn.execute (SQL)

Application("Ca tegoryName") = rs(1).Value
Jul 19 '05 #1
3 1787

"Sean" <NO************ *****@optusnet. com.au> wrote in message
news:Oc******** ******@tk2msftn gp13.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,P arentCatid FROM product_categor ies WHERE
Catid=" &pCatId
set rs = db_conn.execute (SQL)

Application("Ca tegoryName") = rs(1).Value


Im not sure what your aim is,

but

A Application("Ca tegoryName") 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.Loc k and Application.Unl ock when you change a Application
variable

A Session("Catego ryName") 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_Da rkfalz.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******** ******@tk2msftn gp13.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,P arentCatid FROM product_categor ies WHERE
Catid=" &pCatId
set rs = db_conn.execute (SQL)

Application("Ca tegoryName") = rs(1).Value

Jul 19 '05 #3
MN
"Sean" <NO************ *****@optusnet. com.au> wrote in message news:<Oc******* *******@tk2msft ngp13.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,P arentCatid FROM product_categor ies WHERE
Catid=" &pCatId
set rs = db_conn.execute (SQL)

Application("Ca tegoryName") = 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
3064
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 in a databasewhich are retrieved using a GET parameter. I see the advantage to me in using this approach as being making use of MySQL's fulltext search capability and less work needed when updating the design of the page. I'm not sure of a few...
2
8251
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 fields and this BLOB column that stores PDF Files. Until now, the PDF files were read off of a disk drive. The code used was: byte fileAsBytes = (byte) adminDocEvent.getFile(); which returns an object.
1
2144
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 other node, do I need to add one more item in the ListNode OR I only call the queue insert function to do it ?
6
2582
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 "SEGV" when run (presumably - attempt to delete deleted memory. Please take a look and see if you can notice any mistakes I'm making. Basically, I want to store classes of my objects in a vector. I also have three further questions:
12
3956
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
2146
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 database since most of the sites information is all stored there. As well there would be only one place to worry about backing up. And if the file on the hard-drive was ever missing or became corrupted, I could restore it form tha database. Is...
2
1941
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 other node, do I need to add one more item in the ListNode OR I only call the queue insert function to do it ?
6
1735
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 until now I've been sending the track info to a seperate server app using serialization/sockets which stores the metadata in a mysql db so that I can query on Artist/Album etc as well. However, I'm looking to remove the server and move into a more...
7
3254
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 100CE in a date field. This is for a world history database that I am building. I am currently storing dates in a database as unformatted text (14 characters: mm/dd/yyyy/. This requires using alot of extra VBA code to validate the dates to ensure...
1
1705
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 based on the user's ID key (a Guide). But I'm wondering what some of the advantages and disadvantages are of this approach over storing the images in the database. If it makes any difference, the image will be shown on virtually every page.
0
9511
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10408
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10139
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9020
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5417
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3700
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.