Hi all, I'm trying to query a table to see if an item has already been added.
If it hasn't, then add the item to the table and display all the items in the
table. If it is already in the table, then just display all the items in the
table. This is what I have so far, but it only checks the first item in the
table, not all of them. Any ideas? <cfquery name='checkSemCart'
datasource='seminar'> SELECT * FROM SemCartT WHERE ClientID =
#session.ClientID# </cfquery> <cfif #checkSemCart.ActID# EQ '#url.ActID#'>
<cfquery name='getSemCart' datasource='seminar'> SELECT DISTINCT s.*, a.*
FROM SemCartT s, ActivityListingT a WHERE s.ClientID = #session.ClientID#
AND s.ActID = a.ActID </cfquery> <cfquery name='totalPrice'
datasource='seminar'> SELECT SUM(ActCost) AS TotalPrice FROM 'SemCartT and
ActivityListingT' WHERE ClientID = #session.ClientID# </cfquery> <cfelse>
<cfquery name='addSeminar' datasource='seminar'> INSERT INTO
SemCartT(ClientID,ActID) values('#session.ClientID#','#url.ActID#')
</cfquery> <cfquery name='getSemCart' datasource='seminar'> SELECT DISTINCT
s.*, a.* FROM SemCartT s, ActivityListingT a WHERE s.ClientID =
#session.ClientID# AND s.ActID = a.ActID </cfquery> <cfquery
name='totalPrice' datasource='seminar'> SELECT SUM(ActCost) AS TotalPrice
FROM 'SemCartT and ActivityListingT' WHERE ClientID = #session.ClientID#
</cfquery> </cfif>