Chris,

1) in the htmp project form, give all the employee checkboxes the same
NAME, but use the employee id as the VALUE. That way, when you submit
the form, you will have one single variable (the NAME) with a list of
employee ids (the VALUES).

2) first delete all the entries for this PROJECT in the link table (use
<cfquery> and delete where project_id = ...)

3) then loop through the employee ids (use <cfloop>) and execute one
insert per iteration, (again using <cfquery> and insert into...) adding
the employee to the project.

/t

>-----Original Message-----
>From: Chris Kavanagh [mailto:[EMAIL PROTECTED] 
>Sent: Monday, January 31, 2005 4:55 PM
>To: CF-Talk
>Subject: Too stupid for CF
>
>Dear list,
>
>In my task management system, certain people have access to certain 
>projects.
>
>I'd like an admin screen for each project that displays all the people 
>with a checkbox beside their name.  The sysad can check or uncheck 
>people as necessary.
>
>But I'm a bit confused how best to execute this (using MySQL and CF).
>
>My first thought was that each project would have its own table in the 
>backend.  It'd have one column that would contain all the person_ids.
>
>PROJECT IHATECODING
>---
>01
>04
>06
>
>So users 01, 04, and 06 would have access to project "ihatecoding".
>
>But of course I can't do this because users can create projects on the 
>fly.  So I made a table that combined project_ids and person_ids:
>
>PROJ_ID        | PERS_ID
>01             | 03
>01             | 05
>02             | 03
>
>But how the hell do I update this using CF?  Do I CFINSERT or CFUPDATE 
>or what?  And how do I tell my app to remove people when they're 
>unchecked?  This is killing me.  I feel like I can almost see how this 
>is supposed to work but I'm like three IQ points short of getting it.  
>:(
>
>Grateful thanks in advance for any help and insights,
>CK.
>
>
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:192332
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=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to