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.
|
|
|
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 |
|
|
amit
|
Posted: 04/29/2004, 4:07 AM |
|
how we retrieve the form value in next form in php
|
|
|
|