*trembles with foam bat in his hand*
Oooh yes..you just wait till this Zachary fellow shows his face...
Ooooh you just wait..

*raises and lowers foam bat in anticipation*
*blinks at the code*
HIYAAA!
*SWAT!*

<cfloop               ="1" to="#x#">
                        = Evaluate("Skillid"&i)>
                level = Evaluate("level" & i)>
          thisempid = #empid#>

*SWIPE!*

<cfquery name=
  SELECT 
  FROM tblMatrix
  WHERE empid=#thisempid# 
 </cfquery>

*BIFF! BIFF! BIFF!*

<cf                                                             l">
  INSERT                                                    (#empid#,
 <cfquer  

 <cfelse 
 <cfquer                                     nel">
  UPDATE          
   SET ski                   
   WHERE empid=#thisempid# AND skillid=#thisskillid#
 </cfquery>
 </cfif>
</cfloop>


*SWIZZLE!*

idskillid, s
#thid#, #thi                            slevel#)
ERT INTO tbl            Matrix (e                                       pid, 
killlevel)                                 VALUES
query nam       e="in           sertrow" dataso                         "personne
and skillid                     =#th                                                   
                 isskillid#isskill
empid, skill
"get                    answp                                   ersonnel">
<cf     set                     
<cfset this                                                                            
 er" datasource="
 <cfset thi                                     sskillid 



*pant..pant*
There..did that help?

0_0

-Gel
;-)
hee hee

-----Original Message-----
From: Erika Foster [mailto:[EMAIL PROTECTED]]


Can anyone help??

Hi - this has got to be an easy fix.  I've got a dynamic form sending a
dynamic amount of fields to a Query.  The form fields Level#i#  are radio
buttons.  Here's the code:

<cfloop index="i" from="1" to="#x#">
 <cfset thisskillid = Evaluate("Skillid"&i)>
 <cfset thislevel = Evaluate("level" & i)>
 <cfset thisempid = #empid#>

 <cfquery name="getanswer" datasource="personnel">
  SELECT empid, skillid
  FROM tblMatrix
  WHERE empid=#thisempid# and skillid=#thisskillid#
 </cfquery>
 <cfif #getanswer.recordcount# is 0>
 <cfquery name="insertrow" datasource="personnel">
  INSERT INTO tblMatrix (empid, skillid, skilllevel) VALUES (#empid#,
#thisskillid#, #thislevel#)
 </cfquery>
 <cfelse>
 <cfquery name="updaterow" datasource="personnel">
  UPDATE tblMatrix
   SET skilllevel=#thislevel#
   WHERE empid=#thisempid# AND skillid=#thisskillid#
 </cfquery>
 </cfif>
</cfloop>

The problem is that if the the user doesn't answer that particular question,
say they don't answer the first question - then this is the error:

An error occurred while evaluating the expression:


 thislevel = Evaluate("level" & i)



Error near line 12, column 8.
----------------------------------------------------------------------------
----

An error has occurred while processing the expression:

   level1


Error near line 1, column 1.


----------------------------------------------------------------------------
----

Error resolving parameter LEVEL1


Okay, so how do I <cfset Level#i# = "">??  That snippet gives me an "Invalid
Parser Construct" error, pointing to the first #.

This has to be easy... its not coming to me and I've wasted far too much
time on this little bit of code.


Erika Foster
engineering-environmental Management
Applications Developer
(505) 866-1654
[EMAIL PROTECTED]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-community@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to