Database Session Class
Hello,
This is my first post and I'm no PHP expert so please be patient with me. ;)
I'm currently reading Chapter 15 Sessions and Authentication of Professional PHP and need some help.
One of the private member variables stores a Db handle and the book mentions that 'In production environments this would be declared elsewhere as a global resource, and the UserSession class would make use of it the same as any other.'. What exactly does that mean?
Does this mean that I can simply create a Db handle at the top of my page and the class should use this? I'm looking to use PDO/MySQL to connect to my database and at the moment I simply have an include that handles my Db connection. How do I go about integrating my Db connection with the UserSession class?
Thanks
|