-----BEGIN PGP SIGNED MESSAGE-----
Hash: MD5

except in the case of  the letter H, if you speak cirrect English ;p
Aitch not haych - man what a bunch of convicts <Grin>



Wednesday, January 8, 2003, 1:41:43 PM, you wrote:


SO> "you need an "H" in your where clause ;)"

SO> "an" is only used when it is proceded by a vowel :)

SO> Regards

SO> Steve Onnis
SO> Domain Concept Designs
SO> +61 422 337 685
SO> +61 3 9444 7504

SO> http://www.domainconceptdesigns.com <http://www.domainconceptdesigns.com>

SO> ("If you think it can't be done, you haven't asked me!") - Steve Onnis





SO> -----Original Message-----
SO> From: [EMAIL PROTECTED]
SO> [mailto:[EMAIL PROTECTED]]On Behalf Of Toby
SO> Tremayne
SO> Sent: Wednesday, January 08, 2003 1:39 PM
SO> To: CFAussie Mailing List
SO> Subject: [cfaussie] RE: Multiple Updates in forms


SO> -----BEGIN PGP SIGNED MESSAGE-----
SO> Hash: MD5

SO> Hi Christian,

SO>    you need an "H" in your where clause ;)

SO> Wednesday, January 8, 2003, 1:33:58 PM, you wrote:

CvdP>> Thanks for your help, I am nearly there but I just cant seem to get
SO> the
CvdP>> action page to work.

CvdP>> For the display page I am using:
CvdP>> ========================

CvdP>> <form name="form1" method="post" action="testprice2.cfm">
CvdP>>   <cfloop query="gtProds">
CvdP>>     <cfoutput>
CvdP>>         <cfset totrows =  #currentrow#>
CvdP>>       #gtProds.prodID#
CvdP>>       <input type="text" name="field_#currentrow#"
CvdP>> value="#Trim(gtProds.RetailPrice)#">
CvdP>>       <input type="hidden" name="prodID_#currentrow#"
CvdP>> value="#gtProds.prodID#">
CvdP>>       <BR>
CvdP>>     </cfoutput>
CvdP>>   </cfloop>
CvdP>> <input type="submit" name="Submit" value="Update">
CvdP>> <input name="totrows" type="hidden" id="totrows"
CvdP>> value="<cfoutput>#totrows#</cfoutput>">
CvdP>> </form>


CvdP>> =======================
CvdP>> For the Action page I am using
CvdP>> =======================

CvdP>> <cfloop from=1 to=#form.totrows# index="i">
CvdP>> <cfquery datasource="timber">
CvdP>> Update Product
CvdP>> SET RetailPrice=#form["field_#i#"]#
CvdP>> WERE prodID=#form["prodID_#i#"]#
CvdP>> </cfquery>
CvdP>> </cfloop>

CvdP>> ==================
CvdP>> I get the error
CvdP>> ODBC Error Code = 37000 (Syntax error or access violation)

CvdP>> [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing
SO> operator) in
CvdP>> query expression '4.0000 WERE prodID=142'.
CvdP>> =================

CvdP>> It should work, I cant figure out why its not.

CvdP>> Any ideas?


CvdP>> Thank you

CvdP>> Christian van der Plaat
CvdP>> Advanced Web Designs - IT3





CvdP>> -----Original Message-----
CvdP>> From: [EMAIL PROTECTED]
CvdP>> [mailto:[EMAIL PROTECTED]]On Behalf Of Steve
SO> Onnis
CvdP>> Sent: Wednesday, 8 January 2003 12:03 PM
CvdP>> To: CFAussie Mailing List
CvdP>> Subject: [cfaussie] RE: Multiple Updates in forms



CvdP>> I wouldnt do this bcause when your looking at large forms, you will
SO> end up
CvdP>> createing more HTML for the browser to render, thus the page taking
SO> longer
CvdP>> to display, and also giving more work to the CF server aswell to
SO> produce the
CvdP>> HTML for the page.


CvdP>> <cfloop query="myQuery">
CvdP>>     <input type="text" name="field_#currentrow#" value="#price#">
CvdP>>     <input type="hidden" name="priceID_#currentrow#"
value="#priceID#">>
CvdP>>  </cfloop>

CvdP>> Regards

CvdP>> Steve Onnis
CvdP>> Domain Concept Designs
CvdP>> +61 422 337 685
CvdP>> +61 3 9444 7504

CvdP>> http://www.domainconceptdesigns.com
SO> <http://www.domainconceptdesigns.com>

CvdP>> ("If you think it can't be done, you haven't asked me!") - Steve Onnis





CvdP>> -----Original Message-----
CvdP>> From: [EMAIL PROTECTED]
CvdP>> [mailto:[EMAIL PROTECTED]]On Behalf Of Adam
CvdP>> Chapman
CvdP>> Sent: Wednesday, January 08, 2003 11:45 AM
CvdP>> To: CFAussie Mailing List
CvdP>> Subject: [cfaussie] RE: Multiple Updates in forms


CvdP>> Well i agree with you on the Evaluate() issue..
CvdP>> but like i said "Below is a very crude example"

CvdP>> But i dont agree that using the "CurrentRow" like
CvdP>> this isnt very good.

CvdP>> Why not just

CvdP>> <cfloop query="myQuery">
CvdP>>     <input type="text" name="field_#currentrow#" value="#price#">
CvdP>>     <input type="hidden" name="priceID_#currentrow#"
value="#priceID#">>
CvdP>>  </cfloop>

CvdP>> then (note the use of one query.. hopefully your chosen
CvdP>> database supports this..)

CvdP>> <cfquery>
CvdP>> <cfloop from=1 to=#form.priceCount# index="i">
CvdP>> UPDATE  Prices
CvdP>> SET             Price = #form["field_#i#"]#
CvdP>> WHERE           PriceID = #form["priceID_#i#"]#;
CvdP>> </cfloop>
CvdP>> </cfquery>

CvdP>> Horses for courses.. one could argue that list
CvdP>> processing is slow?

CvdP>> Regards,
CvdP>> Adam


CvdP>> -----Original Message-----
CvdP>> From: [EMAIL PROTECTED]
CvdP>> [mailto:[EMAIL PROTECTED]]On Behalf Of Steve
SO> Onnis
CvdP>> Sent: Wednesday, 8 January 2003 11:33 AM
CvdP>> To: CFAussie Mailing List
CvdP>> Subject: [cfaussie] RE: Multiple Updates in forms



CvdP>> Firstly, apparently you shouldnt use Evaluate() cause it takes longer
SO> to
CvdP>> process.

CvdP>> I would use this
CvdP>> -------------------
CvdP>> <cfoutput>
CvdP>>         <cfloop from=1 to=#form.priceCount# index="i">
CvdP>>                 #form["field_#i#"]#<br>
CvdP>>         </cfloop>
CvdP>> </cfoutput>
CvdP>> ------------------

CvdP>> Secondly, using the "CurrentRow" like this isnt very good.  You have
SO> no way
CvdP>> of knowing what row to update in your when you run your action.cfm
SO> script.

CvdP>> I would suggest using a unique ID from the query and pass that list if
SO> IDs
CvdP>> to the action form like this
CvdP>> --------------------------------------------------------------
CvdP>> <cfoutput>
CvdP>> <form name="myForm" action="action.cfm">
CvdP>> <input name="priceIDs" type=hidden
SO> value="#ValueList(myQuery.TableID)#">
CvdP>>   <cfloop query="myQuery">
CvdP>>     <input type="text" name="field_#TableID#" value="#price#">
CvdP>>   </cfloop>
CvdP>> </form>
CvdP>> </cfoutput>
CvdP>> --------------------------------------------------------------

CvdP>> This way when you do your update you can refernce a specif field in
SO> your
CvdP>> query to update
CvdP>> -------------------------------------------
CvdP>> <cfloop list="#form.priceIDs#" index="id">
CvdP>>         <cfquery>
CvdP>>                 UPDATE  Prices
CvdP>>                 SET             Price = #form["field_#id#"]#
CvdP>>                 WHERE           PriceID = #id#
CvdP>>         </cfquery>
CvdP>> </cfloop>

CvdP>> Right idea though

CvdP>> Regards

CvdP>> Steve Onnis
CvdP>> Domain Concept Designs
CvdP>> +61 422 337 685
CvdP>> +61 3 9444 7504

CvdP>> http://www.domainconceptdesigns.com
SO> <http://www.domainconceptdesigns.com>

CvdP>> ("If you think it can't be done, you haven't asked me!") - Steve Onnis





CvdP>> -----Original Message-----
CvdP>> From: [EMAIL PROTECTED]
CvdP>> [mailto:[EMAIL PROTECTED]]On Behalf Of Adam
CvdP>> Chapman
CvdP>> Sent: Wednesday, January 08, 2003 11:12 AM
CvdP>> To: CFAussie Mailing List
CvdP>> Subject: [cfaussie] RE: Multiple Updates in forms


CvdP>> Hi Christian,

CvdP>> If you dynamically name your form fields you can so this
CvdP>> quite easily. Below is a very crude example.

CvdP>> form page
CvdP>> ---------
CvdP>> <cfoutput>
CvdP>> <form name="myForm" action="action.cfm">
CvdP>> <input name="priceCount" type=hidden value="#myQuery.recordcount#">
CvdP>>   <cfloop query="myQuery">
CvdP>>     <input type="text" name="field_#currentrwo#" value="#price#">
CvdP>>   </cfloop>
CvdP>> </form>
CvdP>> </cfoutput>

CvdP>> action.cfm
CvdP>> -----------
CvdP>> <cfoutput>
CvdP>> <cfloop from=1 to=#form.priceCount# index="i">
CvdP>> #Evaluate("form.field_#i#")#<br>
CvdP>> </cfloop>
CvdP>> </cfoutput>

CvdP>> Regards,
CvdP>> Adam Chapman

CvdP>> Virtualtours.com.au
CvdP>> mailto:[EMAIL PROTECTED]
CvdP>> Phone: 1300 366 122
CvdP>> (Int: +61 3 9720 5733)
CvdP>> Fax: +61 3 9720 6377)


CvdP>> -----Original Message-----
CvdP>> From: [EMAIL PROTECTED]
CvdP>> [mailto:[EMAIL PROTECTED]]On Behalf Of Christian
CvdP>> van der Plaat
CvdP>> Sent: Wednesday, 8 January 2003 11:00 AM
CvdP>> To: CFAussie Mailing List
CvdP>> Subject: [cfaussie] Multiple Updates in forms


CvdP>> I have a client that want to be able to update the prices in a
SO> category, the
CvdP>> hard part is he wants all the prices listed on one page in text boxes
SO> so he
CvdP>> can update the 20 or so prices for that category by clicking on the
SO> one
CvdP>> submit button so the form will then update the 20 database listings
SO> rather
CvdP>> than updating one field at a time.

CvdP>> How can I do this? I saw it in Coldfusionjournal.com some where but I
SO> can
CvdP>> not find it.


CvdP>> Thank you

CvdP>> Christian van der Plaat
CvdP>> Advanced Web Designs - IT3



CvdP>> ---
CvdP>> You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
CvdP>> To unsubscribe send a blank email to
SO> [EMAIL PROTECTED]

CvdP>> MX Downunder AsiaPac DevCon - http://mxdu.com/


CvdP>> ---
CvdP>> You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
CvdP>> To unsubscribe send a blank email to
SO> [EMAIL PROTECTED]

CvdP>> MX Downunder AsiaPac DevCon - http://mxdu.com/


CvdP>> ---
CvdP>> You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
CvdP>> To unsubscribe send a blank email to
SO> [EMAIL PROTECTED]

CvdP>> MX Downunder AsiaPac DevCon - http://mxdu.com/


CvdP>> ---
CvdP>> You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
CvdP>> To unsubscribe send a blank email to
SO> [EMAIL PROTECTED]

CvdP>> MX Downunder AsiaPac DevCon - http://mxdu.com/


CvdP>> ---
CvdP>> You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
CvdP>> To unsubscribe send a blank email to
SO> [EMAIL PROTECTED]

CvdP>> MX Downunder AsiaPac DevCon - http://mxdu.com/



CvdP>> ---
CvdP>> You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
CvdP>> To unsubscribe send a blank email to
SO> [EMAIL PROTECTED]

CvdP>> MX Downunder AsiaPac DevCon - http://mxdu.com/







SO>  ---------------------------------------

SO>              Life is poetry -
SO>                write it in your own words.

SO>  ---------------------------------------

SO> Toby Tremayne
SO> Technical Team Lead
SO> Code Poet and Zen Master of the Heavy Sleep
SO> Toll Solutions
SO> 154 Moray St
SO> Sth Melbourne
SO> VIC 3205
SO> +61 3 9697 2317
SO> 0416 048 090
SO> ICQ:  13107913

SO> -----BEGIN PGP SIGNATURE-----
SO> Version: 2.6

SO> iQCVAwUAPhuPSEYhrxxXvPlFAQFnVQP/TD8ni2+ungBjtsx05LbcmHsIT+R+dD5m
SO> byoZETtnQqxWpqNInflKUggcGGQUstVNRpsiNeqO9CxR2UTPrdQe6I1bya9VmPkc
SO> ocA2S17y/HJqeWqH/JsSZfUQ+ylkMYBgB8uQrtB4OljN6+9nNvY+xm3U4LiCoi6c
SO> phfyuQnTYkU=
SO> =leXA
SO> -----END PGP SIGNATURE-----


SO> ---
SO> You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
SO> To unsubscribe send a blank email to [EMAIL PROTECTED]

SO> MX Downunder AsiaPac DevCon - http://mxdu.com/


SO> ---
SO> You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
SO> To unsubscribe send a blank email to [EMAIL PROTECTED]

SO> MX Downunder AsiaPac DevCon - http://mxdu.com/







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

             Life is poetry -
               write it in your own words.

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

Toby Tremayne
Technical Team Lead
Code Poet and Zen Master of the Heavy Sleep
Toll Solutions
154 Moray St
Sth Melbourne
VIC 3205
+61 3 9697 2317
0416 048 090
ICQ:  13107913

-----BEGIN PGP SIGNATURE-----
Version: 2.6

iQCVAwUAPhuUo0YhrxxXvPlFAQGixAQAimqUZuhR5BdLcZ7sQrPJMg/uU/exwg7G
niNU1Ifl/DeBCB/C4Y5xqQ1c9grS+ZKXylo3jGMjBW5mVCCXw8WkYVA2PTKbI88/
IQ30lsXEUNmm1KsZVG87IsXlJ6cKKpnVJ+YMARd5VQU8SL55z9Xdw6PzFJy0F1j9
88vseawtalI=
=XWzx
-----END PGP SIGNATURE-----


---
You are currently subscribed to cfaussie as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/

Reply via email to