Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Jan 2005
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    write session variables to access database

    I have a load of info that a user has entered, it is in the form of session variables. Can anyone point me in the direction of how I can write that information back to an accesss database?

    thanks

  • #2
    Senior Coder nikos101's Avatar
    Join Date
    Dec 2006
    Location
    London
    Posts
    1,007
    Thanks
    59
    Thanked 10 Times in 10 Posts
    Em I think you would have to extract the data from the MySQL database into a csv format using a tool like MySQL query browser


  • #3
    New Coder
    Join Date
    Jan 2005
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I don't want to retrieve the info, I want to write it to the database

  • #4
    Senior Coder nikos101's Avatar
    Join Date
    Dec 2006
    Location
    London
    Posts
    1,007
    Thanks
    59
    Thanked 10 Times in 10 Posts
    As far as I am aware php can't write to a microsoft product directly. You'd need ASP to do that perhaps


  • #5
    New Coder
    Join Date
    Jan 2005
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts
    sorry dude...but this is the ASP forum and I mentioned in my first post about writing TO a databse...it seems like you are answering someone elses question.

    I am using ASP and not PHP....thanks for the effort though

  • #6
    Senior Coder nikos101's Avatar
    Join Date
    Dec 2006
    Location
    London
    Posts
    1,007
    Thanks
    59
    Thanked 10 Times in 10 Posts
    now that wasn't very clever of me was it


  • #7
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    What are you having trouble with, exactly? Connecting to a database? Using session variables? You just need to construct a SQL statement, open a connection and execute the statement:

    Code:
    strSQL = "INSERT INTO table (field) VALUES ('" & session("mySessionKey") & "')"
    set oCn = server.createObject("ADODB.Connection")
    oCn.Open(myConnectionString)
    oCn.Execute strSQL
    oCn.Close
    set oCn = nothing

  • #8
    Regular Coder
    Join Date
    Mar 2006
    Location
    Sumter, SC
    Posts
    178
    Thanks
    10
    Thanked 4 Times in 4 Posts
    Spud, it sounds like his biggest issue is figuring out how to parse the session string into its individual parts so it can be inserted into the database.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •