Assuming then that the variable for the cat_id is "myCatID" then you
are after this kind of thing:

<cfset mylist="Advertising,tools">
<cfset myCatID = 1>
<cfloop list="#mylist#" index="listItem">
 <cfquery datasource="classifieds">
   INSERT INTO sub_categories (sub_category,cat_id )
   VALUES (<cfqueryparam cfsqltype="cf_sql_varchar"
value="#listItem#">,<cfqueryparam cfsqltype="cf_sql_numeric"
value="#myCatID #">)
 </cfquery>
</cfloop>

On 8/6/06, Doug <[EMAIL PROTECTED]> wrote:
> I will just do a cfset and insert it manually into the query. Each cat_id
> will be identical for each set of sub_categories.
>
>
> ----- Original Message -----
> From: "James Holmes" <[EMAIL PROTECTED]>
> To: "CF-Talk" <[email protected]>
> Sent: Saturday, August 05, 2006 8:41 PM
> Subject: Re: problem with insert
>
>
> > For a given list of subcategories you want to insert, where is the
> > cat_id coming from?

-- 
CFAJAX docs and other useful articles:
http://www.bifrost.com.au/blog/

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:248934
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to