SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Can we go to a 48 hour day?
    Join Date
    May 2002
    Location
    MI
    Posts
    906
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    working with the connection string

    I am wondering how I can work with the connection string. I am working on a login system for a bunch of different apps I set up so that I can create a single sign on setup. Each of the different projects is in its own db so whenever I try to add the login code I need to switch the connection string, then switch it back when I am done.

    What I want to do is somehow save the connection string, change it over in the login code (if it is needed...so I guess I need to check it first) then change it back when the login process (checking that a user is logged in, has a valid account, and has permissions )

    Is there any links anyone has one something like this? When I var_dump() it all I get is "resource(12) of type (mysql link persistent)" without any usable details as to where the connection string is pointed to and such.

    Thanks
    mitechie.com
    "Techies just think a little differently
    ...at least that is what they keep telling me."

  2. #2
    La la la la la bronze trophy lieut_data's Avatar
    Join Date
    Jun 2003
    Location
    Waterloo, ON
    Posts
    1,517
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd develop a simple MySQL wrapper class, that implements the needed functions (that operate on the DB). Then, for each project, provide the constructor different connection paramters (i.e. username, password, server address, etc...). Then, your login APP can pass around this class, as needed.
    My name is Steve, and I'm a super-villian.

  3. #3
    Can we go to a 48 hour day?
    Join Date
    May 2002
    Location
    MI
    Posts
    906
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yea, I think I will have to look at putting connection info into the constructors and possibly a "connect" function in the class in case I need to switch back and forth within a single document. I was really hoping there was a way to save the current settings to return back to.
    mitechie.com
    "Techies just think a little differently
    ...at least that is what they keep telling me."

  4. #4
    La la la la la bronze trophy lieut_data's Avatar
    Join Date
    Jun 2003
    Location
    Waterloo, ON
    Posts
    1,517
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by deuce868
    Yea, I think I will have to look at putting connection info into the constructors and possibly a "connect" function in the class in case I need to switch back and forth within a single document. I was really hoping there was a way to save the current settings to return back to.
    If you build the object (passing the constructor the need parameters), in a specific file for that project, and simply include it, you can 'save the settings'.
    My name is Steve, and I'm a super-villian.


Bookmarks

Posting Permissions

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