Answered
SQL Update Dynamic form Names
Hello all,
Using CFloop updating SQL table with two or more records.
This page prints user subscriber bill.
GUI;
CFOUTPUT QUERY="PT"
A HREF="PtDemo.cfm?bill_id=#PT.bill_id#" target="_self">#subscriber#
td align="center">#ptnum#
td align="center">#re#
td align="center"><font color="##FF0000">#phone#</font>
<cfset ptamount = 0>
<td align="center" >$ <font color="##ff0000">#ptamount#</font> </td>
<td align="center">#psdate# align="center">#peDate#
<font color="##FF0000">#TV#</font>
$ <font color="##ff0000">#ttamount#</font>
THE AMMOUNT FIELD BELOW IS THE FIELD IN NEED TO UPDATE IN SQL
input type="text" name="amount" value="#tBilledAmount# "
input type="Checkbox" name="bill" value="#bill_id#"
</CFOUTPUT>
PROCESSING FORM
<cfset pdate = dateformat(now(), "mm/dd/yyyy")>
cfset billedVar = "Y">
cfif isdefined("form.bill")>
cfoutput
CFLOOP INDEX="isid" LIST="#form.bill#"
<cfquery name="prcPna" datasource="wCast">
update billing
set billed = 'Y', billed_date = '#pdate#', amount = '#form.amount#', paid = 'y', paid_date = '#pdate#'
where bill_id = #bill_id#
</cfquery>
<!--- <cfoutput>#form.bill#</cfoutput> amount = '#form.ptnum#',--->
</CFLOOP>
</cfoutput>
</cfif>
Using the loop List, I can update the table with field names the are constant.
I need to update the calculated amount with ;
input type="text" name="amount" value="#tBilledAmount# " This will create a list; (#tBilledAmount# ex: "10,11,12")
OR
input type="text" name="#amount#" value="#tBilledAmount# " This will display "unknown field name"
Any ideas will help.
Thank you
T Jones
Using CFloop updating SQL table with two or more records.
This page prints user subscriber bill.
GUI;
CFOUTPUT QUERY="PT"
A HREF="PtDemo.cfm?bill_id=#PT.bill_id#" target="_self">#subscriber#
td align="center">#ptnum#
td align="center">#re#
td align="center"><font color="##FF0000">#phone#</font>
<cfset ptamount = 0>
<td align="center" >$ <font color="##ff0000">#ptamount#</font> </td>
<td align="center">#psdate# align="center">#peDate#
<font color="##FF0000">#TV#</font>
$ <font color="##ff0000">#ttamount#</font>
THE AMMOUNT FIELD BELOW IS THE FIELD IN NEED TO UPDATE IN SQL
input type="text" name="amount" value="#tBilledAmount# "
input type="Checkbox" name="bill" value="#bill_id#"
</CFOUTPUT>
PROCESSING FORM
<cfset pdate = dateformat(now(), "mm/dd/yyyy")>
cfset billedVar = "Y">
cfif isdefined("form.bill")>
cfoutput
CFLOOP INDEX="isid" LIST="#form.bill#"
<cfquery name="prcPna" datasource="wCast">
update billing
set billed = 'Y', billed_date = '#pdate#', amount = '#form.amount#', paid = 'y', paid_date = '#pdate#'
where bill_id = #bill_id#
</cfquery>
<!--- <cfoutput>#form.bill#</cfoutput> amount = '#form.ptnum#',--->
</CFLOOP>
</cfoutput>
</cfif>
Using the loop List, I can update the table with field names the are constant.
I need to update the calculated amount with ;
input type="text" name="amount" value="#tBilledAmount# " This will create a list; (#tBilledAmount# ex: "10,11,12")
OR
input type="text" name="#amount#" value="#tBilledAmount# " This will display "unknown field name"
Any ideas will help.
Thank you
T Jones
