<CFQUERY NAME="get_people" DATASOURCE="taskomatic">
        SELECT person_id FROM people
        WHERE person_id = '#Form.person_id#'
</CFQUERY>

This query is only going to return one record, assuming person_id is an unique 
key.  I suspect what you may be wanting is a IN clause

<CFQUERY NAME="get_people" DATASOURCE="taskomatic">
        SELECT person_id FROM people
        WHERE person_id IN (<cfqueryparam value="#Form.person_id#" list="yes" 
cfsqltype="cf_sql_varchar">)
</CFQUERY>

HTH, otherwise we need to know more about #form.person_ID# and the people table.

--------------
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA
 
"C code. C code run. Run code run. Please!"
- Cynthia Dunning

...-----Original Message-----
...From: Chris Kavanagh [mailto:[EMAIL PROTECTED]
...Sent: Monday, January 31, 2005 11:07 AM
...To: CF-Talk
...Subject: CFLOOP not looping
...
...Dear list,
...
...My CFLOOP doesn't seem to be looping my INSERTS.
...
...A form passes the variables #person_id# & #project_id# to this page:
...
...<head>
...<CFQUERY NAME="get_people" DATASOURCE="taskomatic">
...     SELECT person_id FROM people
...     WHERE person_id = '#Form.person_id#'
...</CFQUERY>
...</head>
...
...<body>
...<CFLOOP QUERY="get_people">
...     <CFQUERY NAME="insert_records" DATASOURCE="taskomatic">
...             INSERT INTO people_project (person_id, project_id)
...             VALUES ('#Form.person_id#', '#Form.project_id#')
...     </CFQUERY>
...</CFLOOP>
...</body>
...
...--
...
...When there are multiple #person_id#s, I was hoping the CFLOOP would
...create multiple rows in the table.  But it doesn't.  :/  What am I
...doing wrong this time?
...
...Many thanks,
...CK.
...
...
...

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:192395
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to