You shoult not set
$this->title in the
__construct() method unless you are planning on using it.It would be better if you set this value in the particular method that is planning on using this data.
The first thing I noticed when I looked at this code is that these properties
public $db;are indeed public. It would be best if you change the visibility to private to ensure that you have more control over the state of these values.
In your connect method you are creating a new PDO object without handling any errors that may occur. The correct approach is to use the PDOException class
to handle this error.
$this->db = new PDO('mysql:host='.$host.';dbname='.$dbname, $username, $password);
catch (PDOException $e)
It's always good to practice making comments in your code to ensure that its easy to follow and if another developer should use your class they will be able to understand exactly whats taking place. phpDoc is a good tool that can be used to generate documentation.
Is this the complete class? I ask this because it seems as if a query function is missing. Making queries with PDO have been simplified thus can implement a simple query method to retrieve to access your database.
public function query($query)
I hope my answers helps somewhat if they are any concerns or errors one can just leave a comment, I am open to criticism.