the need for a switch/case? And if no recordcount then display the
default template.
On Thu, 7 Oct 2004 14:02:49 -0500, Donna French <[EMAIL PROTECTED]> wrote:
> Okay, here's what I've come up with so far. Let me know any comments -
> good, bad or indifferent.
>
> <cfquery name="rsDetails" datasource="#dsn#">
> SELECT *
> FROM tblProducts
> WHERE ProdID = #URL.ProdID#
> </cfquery>
>
> <cfoutput query="rsDetails" datasource="#dsn#">
> <cfswitch _expression_="#Trim(TypeID)#">
> <cfcase value="1">
> <!--- Display layout for TypeID 1 --->
> <cfquery name="rsType1" datasource="#dsn#">
> SELECT *
> FROM tblTypes
> WHERE TypeID = 1
> </cfquery>
> <cfoutput query="rsType1">
> #Trim(TypeDesc)#
> </cfoutput>
> </cfcase>
> <cfcase value="2">
> <!--- Display layout for TypeID 2 --->
> <cfquery name="rsType2" datasource="#dsn#">
> SELECT *
> FROM tblTypes
> WHERE TypeID = 2
> </cfquery>
> <cfoutput query="rsType2">
> #Trim(TypeDesc)#
> </cfoutput>
> </cfcase>
> <cfcase value="3">
> <!--- Display layout for TypeID 3 --->
> <cfquery name="rsType3" datasource="#dsn#">
> SELECT *
> FROM tblTypes
> WHERE TypeID = 3
> </cfquery>
> <cfoutput query="rsType3">
> #Trim(TypeDesc)#
> </cfoutput>
> </cfcase>
> <cfdefaultcase>
> <!--- Display default layout --->
> <cfinclude template="defaultdetails.cfm">
> </cfdefaultcase>
> </cfswitch>
> </cfoutput>
>
> TIA,
> Donna
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

