
Tim
|
| Posted: 08/23/2002, 12:49 PM |
|
Hello all,
I need to make a change in a the database (access/SQL) when the page loads.
I want to Update tbl.bs_orders
Set paid = 1
Where member_id = Session(UserID)
I just can't get it to work.
bs_ orders table has columns named paid (default to 0) and member_id
Do I put this in before show, after initialize? I need the session to be available.
Thanks
|
|
|
 |
Superkikim
|
| Posted: 08/23/2002, 1:20 PM |
|
Hi Tim. Probably a typing mistake... In your message, Session(UserID) should be Session(UserID)
Regardless this issue, I don't know how to do it but I'm pretty interested if someone has an answer, because I want to add a "view" counter in a forum for each message. I need the viewthread page to increase the view field for the selected message.
|
|
|
 |
tim
|
| Posted: 08/23/2002, 1:55 PM |
|
Yeah It should be session("userid")
|
|
|
 |
Nicole
|
| Posted: 08/24/2002, 3:21 AM |
|
Tim,
Here is sample code for ASP (CCS). Put it into page After Initialize event:
Dim conn
Set conn = new clsDBconnection_name
conn.Open
Dim tmp
tmp = CCExecSQL("Update tbl.bs_orders Set paid = 1 Where member_id = " & CCGetSession("UserID"), conn, "error message")
'OR
conn.execute("Update tbl.bs_orders Set paid = 1 Where member_id = " & CCGetSession("UserID"))
conn.Close
Set conn = Nothing
Superkikim,
I remember that there’re several postings about how to add hit counter. Please search on "hit count" keywords on the discussion board. In case you need code adapted for CCS, please refer to code snippet posted above.
|
|
|
 |
|

|