Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

10
  • change MonthlySums::$dbh->query($sql); to self::$dbh->query($sql); Commented Apr 15, 2016 at 10:10
  • Fatal error: Access to undeclared static property: Settings::$dbh in
    – pollux1er
    Commented Apr 15, 2016 at 10:10
  • Ok, the previous error is back again
    – pollux1er
    Commented Apr 15, 2016 at 10:12
  • Why have it static in the first place?
    – ka_lin
    Commented Apr 15, 2016 at 10:12
  • 1
    When you call a static method in a class the constructor is not automatically invoked like when you create an instance of the class. With your code you would have to create at least once instance of the class so that the database connection would be set in your static variable. Then you would be able to call it in your desired static way.
    – ST2OD
    Commented Apr 15, 2016 at 10:25