point. I only want to create the color objects associated with the item
object being initialized.
instance.colors = newArray(1);
...
<cfquery name="colors" datasource="#application.DSN#>
select intColorID
from tblapparelitemcolors
where intApparelItemID = #arguments.ID#
</cfquery>
... // and stuff here
<cfscript>
instance.ID = arguments.ID;
instance.itemname = item.name;
instance.itemsubcat = item.subcat;
... // more code here
[this doesn't work, but is what I'm trying to figure out]
<cfoutput query="colors">
instance.colors[colors.currentrow] = createObject('component','Color');
instance.colors[colors.currentrow] =
instance.colors[colors.currentrow].get(colors.intColorID);
</cfoutput>
... // more code here
</cfscript>
... // and it goes on
Hope this clarifies what I'm trying to do...
Cutter
Tim Heald wrote:
> You do an array loop through the query using writeOutput()
>
> something like this should work:
>
> for(i = 1; i lt myQuery.recordCount; i = i + 1){
> writeOutput(myQuery.myColumn[i] & '<br>');
> }
> -----Original Message-----
> From: Cutter (CF-Talk) [mailto:[EMAIL PROTECTED]
> Sent: Saturday, March 27, 2004 7:56 PM
> To: CF-Talk
> Subject: Query Output in a cfscript
>
> I have an object for an apparel item. This item may come in 10 different
> colors. I have a db table which will have an entry for each color
> associated with an item (referenced by the item id and the color id).
> When initializing my apparel item I want to have a property of colors.
> This would be an array of color objects. I can easily query the db to
> get the recordsets associated with the item, but how would I loop
> through the recordset within a <cfscript> block? Can you place a
> <cfoutput> tag inside a <cfscript> block?
>
> Cutter
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

