0

I have started work with OOP, and i have problems with creation database connection class.

I used to work with non-OOP PHP so now it is like to start learning something really hard.

Could U help me with creation of class or advise some articles about creation and using class?

myrko
  • 49
  • 1
  • 9

1 Answers1

0

Singletons are considered bad practice. You should use Dependency Injection instead.

You will have a single instance of a database class, the concept of a singleton disappears when you're using Dependency Injection.

Halcyon
  • 57,230
  • 10
  • 89
  • 128