CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Retrieve form value in custom update

Print topic Send  topic

Author Message
sappie

Posts: 13
Posted: 02/06/2004, 9:56 AM

From a query I'd like to perform an update using ASP. The form (poll) contains the number of the "vote_id".

I used following code, hower this doesn't update the table:
DIM BNConnection
Set BNConnection = New clsDBVoteDB
BNConnection.Open
BNConnection.Execute("UPDATE vote_items SET vote_results = vote_results + 1 WHERE vote_id = '" & GetParam("vote_id") & "' and vote_item_id = 1")
BNConnection.Execute("INSERT INTO user_votes (vote_item_id, vote_id, user_ip) VALUES (1, 1, '" & Request.ServerVariables("REMOTE_HOST") & "')")
BNConnection.Close

If i replace " & GetParam("vote_id") & "' by a constant (1) it works fine.
Can someone please tell me wat I'm doin wrong?
Harold.
View profile  Send private message
peterr


Posts: 5971
Posted: 02/06/2004, 2:52 PM

If vote_id is numeric (I'm guessing) then you should remove the apostrophes.
I also recommend using CCToSQL function, like:
BNConnection.Execute("UPDATE vote_items SET vote_results = vote_results + 1 WHERE vote_id = " & CCToSQL(GetParam("vote_id"),ccsInteger) & " and vote_item_id = 1")
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
amit
Posted: 04/29/2004, 4:07 AM

how we retrieve the form value in next form in php

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.