I've got a form that is made up of a dynamic list of form fields.How do I
write the SQL query so that it will loop over all of the fields to do the
insert?
My form:
cfquery name=golfers datasource=#DSN# username=#db_username#
password=#db_password#
SELECT*
FROMgolfers
ORDER BY
golfer_name
, March 11, 2004 8:38 AM
To: CF-Talk
Subject: Insert dynamic form fields into a database
I've got a form that is made up of a dynamic list of form fields.How do I
write the SQL query so that it will loop over all of the fields to do the
insert?
My form:
cfquery name=golfers datasource=#DSN# username
maart 2004 14:38
To: CF-Talk
Subject: Insert dynamic form fields into a database
I've got a form that is made up of a dynamic list of form
fields.How do I write the SQL query so that it will loop
over all of the fields to do the insert?
My form:
cfquery name=golfers datasource=#DSN
To: CF-Talk
Subject: RE: Insert dynamic form fields into a database
All you need to do is loop through your form collection on the
post_golfer_form.cfm page.Since your textboxes names are the golfers
IDs, then you can use the textbox value to adjust the purse and the name of
the textbox as the where
UPDATE golfers
SET golfer_purse = '#form[thefield]#'
WHERE golfer_id = #thefield#
-Original Message-
From: Jillian Carroll [mailto:[EMAIL PROTECTED]
Sent: donderdag 11 maart 2004 15:12
To: CF-Talk
Subject: RE: Insert dynamic form fields into a database -
More Help Needed
Let me correct myself (see inline):
Pascal
-Original Message-
From: Pascal Peters
Sent: donderdag 11 maart 2004 14:58
To: CF-Talk
Subject: RE: Insert dynamic form fields into a database
If your database is case-insensitive or golfer_id is uppercase (or
numeric):
cfloop
-Talk
Subject: RE: Insert dynamic form fields into a database - More Help Needed
Okay, I'm an idiot this morning.
I don't understand what I'm supposed to be substituting.
My code:
cfloop index=thefield list=#form.fieldnames#
cfquery name=golfersupdate datasource=#DSN#
username=#db_username
From: Hagan, Ryan Mr
UPDATE golfers
SET golfer_purse = #evaluate(form.#thefield#)#
WHERE golfer_id = #thefield#
YUK! Ditch the Evaluate()
SET golfer_purse = #form[thefield]#
So much faster and cleaner
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User
:12 AM
To: CF-Talk
Subject: RE: Insert dynamic form fields into a database - More Help Needed
Okay, I'm an idiot this morning.
I don't understand what I'm supposed to be substituting.
My code:
cfloop index=thefield list=#form.fieldnames#
cfquery name=golfersupdate datasource=#DSN#
username
cfQueryparam! cfQueryparam! cfQueryparam! cfQueryparam! cfQueryparam!
Marlon
-Original Message-
From: Philip Arnold [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 11, 2004 8:47 AM
To: CF-Talk
Subject: RE: Insert dynamic form fields into a database - More Help Needed
From: Hagan
From: Marlon Moyer
cfQueryparam! cfQueryparam! cfQueryparam! cfQueryparam! cfQueryparam!
To Camel Cap that properly, shouldn't it be cfQueryParam? g
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
11 matches
Mail list logo