CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> Archive -> GotoCode Archive

 Before Show Help, SQL update, ASP and CCS

Print topic Send  topic

Author Message
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.

   


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

Web Database

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.