User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ColdFusion section within the Web Development category of DaniWeb, a massive community of 332,614 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,139 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ColdFusion advertiser:
Views: 579 | Replies: 4
Reply
Join Date: Apr 2008
Posts: 2
Reputation: berlindeb is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
berlindeb berlindeb is offline Offline
Newbie Poster

insert loop

  #1  
28 Days Ago
I am not sure how to ask the question, but here goes. I have a multiline survey storing data about a specific project. I want to store the data in the following fields:
proj_id
strat_issue
strat_goal
strat_obj
strat_value

here is an example of my code
  1. <form action="strat_survey.cfm?update=gogo" method="post">
  2.  
  3. <table width="90%" border="1" cellpadding="3" cellspacing="0" bordercolor="#CCCCCC">
  4. <tr>
  5. <td colspan="3" align="center"><strong><font color="#0000FF">Project Alignment
  6. with 2007-2010 STRATEGIC ISSUES, GOALS, AND OBJECTIVES</font></strong></td>
  7. <td><font size="2"><strong>Project Aligns with Objective</strong></font></td>
  8. </tr>
  9. <tr>
  10. <td colspan="3"><strong>Service Delivery - It is critical that we employ strategies
  11. to ensure excellent service delivery.</strong></td>
  12. <td>&nbsp;</td>
  13. </tr>
  14. <tr>
  15. <td width="2%">&nbsp;</td>
  16. <td width="2%">1</td>
  17. <td width="86%">Develop a comprehensive Customer Service Action Plan to enhance
  18. the delivery of Department services.</td>
  19. <td width="10%">&nbsp;</td>
  20. </tr>
  21. <tr>
  22. <td>&nbsp;</td>
  23. <td>&nbsp;</td>
  24. <td>1.1 Establish methods to continually assess internal and external customer
  25. satisfaction.</td>
  26. <td> <input type="checkbox" name="strat_value" value="1"> <input type="hidden" name="strat_issue" value="Service Delivery">
  27. <input type="hidden" name="strag_goal" value="1"> <input type="hidden" name="strat_ob" value="1.1"></td>
  28. </tr>
  29. <tr>
  30. <td>&nbsp;</td>
  31. <td>&nbsp;</td>
  32. <td>1.2 Implement service level improvements to assist customers and improve
  33. efficiency and effectiveness. (wait times, credit cards)</td>
  34. <td> <input type="checkbox" name="value2" value="1"> <input type="hidden" name="strat_issue" value="Service Delivery">
  35. <input type="hidden" name="strat_goal" value="1"> <input type="hidden" name="strat_obj" value="1.2"></td>
  36. </tr>
  37. </table>

This insert code only inserts the same value for all fields

  1. <cfquery name="strat_post" datasource="#request.dsn#">
  2. INSERT INTO proj_strat_align
  3. (strat_issue,strat_goal,strat_obj,strat_value)
  4. values
  5. ('#form.strat_issue#','#form.strat_goal#','#strat_obj#','#strat_value#')
  6. </cfquery>


Thanks
Last edited by peter_budo : 26 Days Ago at 6:52 pm. Reason: Keep It Organized - please use [code] tags
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2008
Posts: 32
Reputation: cmhampton is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 3
cmhampton cmhampton is offline Offline
Light Poster

Re: insert loop

  #2  
28 Days Ago
One thing to check is to cfdump the form structure and make sure that the data from the form is correct.

  1. <cfdump var="#form#">

Do you have any <cfset> statements that could be over-writing the value of those form variables? If possible, please post the entire strat_survey.cfm page so we can look at it more thoroughly.

Thanks
Reply With Quote  
Join Date: Apr 2008
Posts: 2
Reputation: berlindeb is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
berlindeb berlindeb is offline Offline
Newbie Poster

Re: insert loop

  #3  
25 Days Ago
Here are the results from the CFDUMP
struct
FIELDNAMES STRAT_VALUE,STRAT_ISSUE,STRAG_GOAL,STRAT_OBJ,VALUE2,STRAT_GOAL
SEARCHSTRING [empty string]
STRAG_GOAL 1
STRAT_GOAL 1
STRAT_ISSUE Service Delivery,Service Delivery
STRAT_OBJ 1.1,1.2
STRAT_VALUE 1
VALUE2 1

Here is how the data was stored

recnum; 22
recdate: 04/21/2008
blog_id:
strat_issue: Service Delivery,Service Delivery
strat_goal: 1
Strat_obJ: 1.1,1.2
strat_value: 1

I need it to update two records, like this

1.
recnum 1
recdate 04/21/2008
blog_ID
strat_issue Server Delivery
strat_goal 1
strag_obj 1.1
strat_value 1

2.
recnum 1
recdate 04/21/2008
blog_ID
strat_issue Server Delivery
strat_goal 1
strag_obj 1.2
strat_value 1
Reply With Quote  
Join Date: Feb 2008
Posts: 32
Reputation: cmhampton is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 3
cmhampton cmhampton is offline Offline
Light Poster

Re: insert loop

  #4  
23 Days Ago
I'll have a look at it tomorrow and see if I can help.
Reply With Quote  
Join Date: Oct 2005
Posts: 8
Reputation: jamba is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
jamba jamba is offline Offline
Newbie Poster

Re: insert loop

  #5  
15 Days Ago
At first glance - looks like you have a typo:
<input type="hidden" name="strag_goal" value="1"> <input type="hidden" name="strat_ob" value="1.1">
 

name="strat_obj" ??
Last edited by jamba : 15 Days Ago at 8:14 am.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb ColdFusion Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the ColdFusion Forum

All times are GMT -4. The time now is 1:37 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC