Hi Guys - this has got to be something really stupid... but for some reason CFUPDATE is totally ignoring me and I can't figure this one out.
Here is the form:
<cfquery name="getanswers" DATASOURCE="chamber">
select * from poll_answer
WHERE question_id = #pollid#
</cfquery>
<cfoutput query="getanswers">
<FORM action="votecount2.cfm" METHOD="post">
#answer# <INPUT TYPE="radio" NAME="id" VALUE="#id#"><br>
</cfoutput></p>
<INPUT TYPE=Submit VALUE="Vote!"></form>
And here is the action page:
<cfquery name="addone" DATASOURCE="chamber">
select * from poll_answer
where id = #id#
</cfquery>
<cfoutput query="addone">
<cfset newcount=#count#+1><br>
</cfoutput>
<cfset count=#newcount#>
<CFUPDATE DATASOURCE="chamber" TABLENAME="poll_answer">
<cfoutput query="addone">#id# #question_id# #answer# #count#<BR></cfoutput>
Basically what I am doing is pulling answers out of a database to a question, based on their question_id matching the id of the question. The answers will display with a radio button next to them, which you can click and submit your vote. All I want to do is add 1 to the count value of that answer. I've FINALLY gotten this to the point where i'm not getting an error message, but now the cfupdate just doesn't seem to add the new value of the count. Any ideas?
Thanks!
Here is the form:
<cfquery name="getanswers" DATASOURCE="chamber">
select * from poll_answer
WHERE question_id = #pollid#
</cfquery>
<cfoutput query="getanswers">
<FORM action="votecount2.cfm" METHOD="post">
#answer# <INPUT TYPE="radio" NAME="id" VALUE="#id#"><br>
</cfoutput></p>
<INPUT TYPE=Submit VALUE="Vote!"></form>
And here is the action page:
<cfquery name="addone" DATASOURCE="chamber">
select * from poll_answer
where id = #id#
</cfquery>
<cfoutput query="addone">
<cfset newcount=#count#+1><br>
</cfoutput>
<cfset count=#newcount#>
<CFUPDATE DATASOURCE="chamber" TABLENAME="poll_answer">
<cfoutput query="addone">#id# #question_id# #answer# #count#<BR></cfoutput>
Basically what I am doing is pulling answers out of a database to a question, based on their question_id matching the id of the question. The answers will display with a radio button next to them, which you can click and submit your vote. All I want to do is add 1 to the count value of that answer. I've FINALLY gotten this to the point where i'm not getting an error message, but now the cfupdate just doesn't seem to add the new value of the count. Any ideas?
Thanks!