Hi there,
I have a radio button field, form.SlopAnswer, that dictates which db field
should be incremented by one, but I'm not sure how to update the DB.
The value of the form field is exactly that of the db field, but could be
any one of four different values/db fields.
So for the update I tried something like:
<cfquery name="qSlopUpdate" datasource="mpg">
update slop
set slop.#form.SlopAnswer# = (slop.#form.SlopAnswer# + 1) where qID = 1
</cfquery>
The table is called slop, the qID is the auto_increment ID primary key
assigned to the record I need to update.
Can someone please offer some pointers and perhaps any links that
specifically deal with arithmetic in queries?

Signature
Tks,
Lossed
--------------------------------------------------------------------------------------------------------
When the only tool you have is a hammer, everything looks like a nail :-)
--------------------------------------------------------------------------------------------------------
TheFunnyMonkey - 29 Oct 2004 19:21 GMT
seem really dangerous still. hacker could inject own field name that not
number or number out of range and get access to database. example above still
allow letter. shoult be: <cfset form.slopanswer =
ReReplaceNoCase(form.slopanswer, '[^0-9]', '', 'all')> then compare number
use cfif.