View Single Post
  #1 (permalink)  
Old February 4th, 2006, 12:19 PM
sw8370 sw8370 is offline
Registered User
 
Join Date: Feb 2006
Location: Aberdeen, , United Kingdom.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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