Hopefully this is a straight forward question:
I am looking to create a class, and I want to include my database variable ($mysql) in it so I can do DB interactions. So far, I've been making it global inside functions, but I'm hoping that rather then including the variable globally in every class function, there was some way to simply include it into the class/access it in the class. I'm not very good with scoping.
The only option I can think of is to create a class variable and in the constructor, include the variable globally and assign it (maybe by reference, does that make sense?) to the class variable.
Any other options?