Hi,
I'm new to the list. Can somebody help me? I want to list the contents
of one table only where the primary key is paired with a client's
specific session variable from another table. It's like a real simple
shopping cart concept. I'm trying to understand "applications", and I
think when I use one I can spawn a session variable that is specific to
a client. I have listed some of the code for this below. In the
"mq_our_select.cfm" template a client can choose a mala (worry beads --
sort of a necklace) from a table in "data" called "mq_our". The next
template after making the choice should display the details of the
chosen mala as shown in the third file �m1_our_list.cfm.�. But I want
that third file to do more. I want it to search the second table called
�sessions�, which contains pairings of sessionID�s with previously
chosen malaID�s. If a sessionID match is found, it means the customer
chose some malas earlier in the session, and these should also be
displayed. How do I accomplish this? Essentially, the pseudo code for
the query I want for that third file would be something like
<CFQUERY DATASOURCE="data" NAME="mq_our">
SELECT prod_num,bead
FROM mq_our FOR all malaID in the �sessions� table where the sessionID
matches this current sessionID
</CFQUERY>

Thanks in advance for any help!
Megan

##### application.cfm for malaquest ####
##### Define the application parameters ####
<cfapplication name="malaquest"
               clientmanagement="Yes"
               sessionmanagement="Yes"
               sessiontimeout="#CreateTimeSpan(0,0,30,0)#"
               applicationtimeout="#CreateTimeSpan(1,0,0,0)#">
##### Initialize application variables ####
<cfif not isDefined("session.num")>
 <cfset session.num = 1>
 <cfset application.currentUser = iif(isDefined("client.clientName"),
"client.clientName", DE("guest from #CGI.REMOTE_ADDR#"))>
</cfif>
<cfif not isDefined("session.addToken")>
 <cfset session.addToken = DE("#client.URLToken#")>
</cfif>

##### mq_our_select.cfm ####
<CFQUERY DATASOURCE="data" NAME="mq_our">
 SELECT malaID, pic
 FROM mq_our
</CFQUERY>
<html>
<body>
<table width="100%">
<tr>
<CFOUTPUT QUERY="mq_our">
<td>
<A HREF="mq_our_list.cfm?malaID=#malaID#">
     <img src="#pic#" border="0"></A>
</td>
</CFOUTPUT>
</tr>
</table>
</body>
</html>

##### mq_our_list.cfm ####
<CFQUERY DATASOURCE="data" NAME="mq_our">
SELECT prod_num,bead
FROM mq_our
WHERE malaID = #malaID#
</CFQUERY>
<html>
<body>
<CFOUTPUT QUERY="mq_our">
<B>Product Number:</B> #prod_num#<BR>
<B>Bead:</B> #bead#
</CFOUTPUT>
</body>
</html>


------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to