I am not sure if this is totally the wrong thing to do, so I am looking for a bit of advice.

I have set up a database class with the constructor establishing a [PDO](https://en.wikipedia.org/wiki/PHP#Development_and_community) connection to a MySQL database.

I've been looking at [singletons](http://en.wikipedia.org/wiki/Singleton_pattern) and global variables, but there always seems to be someone who recommends against either/or.

I'm experimenting with a user class which extends the database class, so I can call upon the PDO functions/methods but maintain separate user class code. Is this a stupid thing to do?