PHP - How to access pdo object from other (multiple) classes
问题 I am switching my MVC to use PDO (I know, overdue). My application has, in the past, used the following class hierarchy: Database.class>Main.class>User.class (each one extending the other). But before any object is created, the mysql connection was made (mysql_connect). Once the connection was open I could use Database.class as a wrapper class through which all my queries were performed. Through extention, a query in the User.class could be made simply by calling the "query" function ($this-