VALUES ('#q#', #form.girlwname#)#)

You have an extra #) It should be...

VALUES ('#q#', #form.girlwname#)

But REALLY should be...

VALUES (<cfqueryparam cfsqltype="cf_sql_varchar" value="#q#" />,
<cfqueryparam cfsqltype="cf_sql_int" value="#form.girlwname#" />)

If those datatypes are varchar and int (or text and number)

..:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com


-----Original Message-----
From: Toby King [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 30, 2007 9:18 AM
To: CF-Talk
Subject: fixing a piece of code

Hi there

I have a 2 programs one which displays dual select boxes on the screen.  A
user click on  a persons name in the left-hand selection box and move the
name to the right-hand box and vice versa.

A button is at the bottom of the screen and when the user presses the button
the names in the right hand sidebox will then be used to update a table in
the database.

The trouble is that the code isnt working and  cant see why:

I keep getting an error:

Context validation error for the cfloop tag.  
The start tag must have a matching end tag. An explicit end tag can be
provided by adding </cfloop>. If the body of the tag is empty, you can use
the shortcut <cfloop .../>. 

Here is the code that I have:

<cfquery name="qdeleterecs" datasource="#request.db_dsn#"
username="#request.db_login#" password="#request.db_pwd#">
                DELETE
                FROM tbl_onshift
</CFQUERY>

<cfloop list="#girls#" index="q"> 
         <cfquery name="qinsertrecs" datasource="#request.db_dsn#"
username="#request.db_login#" password="#request.db_pwd#">
          INSERT INTO tbl_onshift (girlid, girlwname) 
          VALUES ('#q#', #form.girlwname#)#) 
     </cfquery> 
</cfloop> 

Any thoughts would be greatly appreciated - I have been stuck on this for a
couple of hours.

Regards






~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Enterprise web applications, build robust, secure 
scalable apps today - Try it now ColdFusion Today
ColdFusion 8 beta - Build next generation apps

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

Reply via email to