Inkfast
2009-03-21 23:05:10 UTC
I'm really missing something here that I know is very simple and I'm going to
kick myself when I get an answer but here goes. I have a query that is getting
simple numbers from the db and then a series of if statements looking for the
numbers and then performing the function I need. My problem is I'm only getting
a positive result on the first row of the query. I created a simple test page
to demonstrate.
<cfquery datasource="#dsn#" name="GetRawMaterials">
Select market_component_id
From tbl_team_component
Where team_cycle_id = '#Session.team_cycle_id#'
</cfquery>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Containso-8859-1"
/>
<title>Untitled Document</title>
</head>
<body>
<cfif Isdefined("GetRawMaterials.market_component_id") And
GetRawMaterials.market_component_id Contains "27">
27: Yes
<cfelse>
27: No
</cfif>
<br />
<cfif Isdefined("GetRawMaterials.market_component_id") And
GetRawMaterials.market_component_id Contains "28">
28: Yes
<cfelse>
28: No
</cfif>
<br />
<cfif Isdefined("GetRawMaterials.market_component_id") And
GetRawMaterials.market_component_id Contains "29">
29: Yes
<cfelse>
29: No
</cfif>
<br />
<cfif Isdefined("GetRawMaterials.market_component_id") And
GetRawMaterials.market_component_id Contains "30">
30: Yes
<cfelse>
30: No
</cfif>
<br />
<cfif Isdefined("GetRawMaterials.market_component_id") And
GetRawMaterials.market_component_id Contains "31">
31: Yes
<cfelse>
31: No
</cfif>
<br />
<cfif Isdefined("GetRawMaterials.market_component_id") And
GetRawMaterials.market_component_id Contains "32">
32: Yes
<cfelse>
32: No
</cfif>
<br />
<cfif Isdefined("GetRawMaterials.market_component_id") And
GetRawMaterials.market_component_id Contains "33">
33: Yes
<cfelse>
33: No
</cfif>
<br />
<cfif Isdefined("GetRawMaterials.market_component_id") And
GetRawMaterials.market_component_id Contains "34">
34: Yes
<cfelse>
34: No
</cfif>
<br />
<cfif Isdefined("GetRawMaterials.market_component_id") And
GetRawMaterials.market_component_id Contains "35">
35: Yes
<cfelse>
35: No
</cfif>
<br />
<cfif Isdefined("GetRawMaterials.market_component_id") And
GetRawMaterials.market_component_id Contains "36">
36: Yes
<cfelse>
36: No
</cfif>
<br />
<cfif Isdefined("GetRawMaterials.market_component_id") And
GetRawMaterials.market_component_id Contains "37">
37: Yes
<cfelse>
37: No
</cfif>
<br />
<cfif Isdefined("GetRawMaterials.market_component_id") And
GetRawMaterials.market_component_id Contains "38">
38: Yes
<cfelse>
38: No
</cfif>
</body>
</html>
kick myself when I get an answer but here goes. I have a query that is getting
simple numbers from the db and then a series of if statements looking for the
numbers and then performing the function I need. My problem is I'm only getting
a positive result on the first row of the query. I created a simple test page
to demonstrate.
<cfquery datasource="#dsn#" name="GetRawMaterials">
Select market_component_id
From tbl_team_component
Where team_cycle_id = '#Session.team_cycle_id#'
</cfquery>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Containso-8859-1"
/>
<title>Untitled Document</title>
</head>
<body>
<cfif Isdefined("GetRawMaterials.market_component_id") And
GetRawMaterials.market_component_id Contains "27">
27: Yes
<cfelse>
27: No
</cfif>
<br />
<cfif Isdefined("GetRawMaterials.market_component_id") And
GetRawMaterials.market_component_id Contains "28">
28: Yes
<cfelse>
28: No
</cfif>
<br />
<cfif Isdefined("GetRawMaterials.market_component_id") And
GetRawMaterials.market_component_id Contains "29">
29: Yes
<cfelse>
29: No
</cfif>
<br />
<cfif Isdefined("GetRawMaterials.market_component_id") And
GetRawMaterials.market_component_id Contains "30">
30: Yes
<cfelse>
30: No
</cfif>
<br />
<cfif Isdefined("GetRawMaterials.market_component_id") And
GetRawMaterials.market_component_id Contains "31">
31: Yes
<cfelse>
31: No
</cfif>
<br />
<cfif Isdefined("GetRawMaterials.market_component_id") And
GetRawMaterials.market_component_id Contains "32">
32: Yes
<cfelse>
32: No
</cfif>
<br />
<cfif Isdefined("GetRawMaterials.market_component_id") And
GetRawMaterials.market_component_id Contains "33">
33: Yes
<cfelse>
33: No
</cfif>
<br />
<cfif Isdefined("GetRawMaterials.market_component_id") And
GetRawMaterials.market_component_id Contains "34">
34: Yes
<cfelse>
34: No
</cfif>
<br />
<cfif Isdefined("GetRawMaterials.market_component_id") And
GetRawMaterials.market_component_id Contains "35">
35: Yes
<cfelse>
35: No
</cfif>
<br />
<cfif Isdefined("GetRawMaterials.market_component_id") And
GetRawMaterials.market_component_id Contains "36">
36: Yes
<cfelse>
36: No
</cfif>
<br />
<cfif Isdefined("GetRawMaterials.market_component_id") And
GetRawMaterials.market_component_id Contains "37">
37: Yes
<cfelse>
37: No
</cfif>
<br />
<cfif Isdefined("GetRawMaterials.market_component_id") And
GetRawMaterials.market_component_id Contains "38">
38: Yes
<cfelse>
38: No
</cfif>
</body>
</html>