PDO not throwing any exceptions

If you want pdo to thow exception so that you can see what is going on kinda thing.. you can add the following parameter when you instantiate PDO just next to the password part of the pdo

                                                                                                PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION)

**Note: This is not the best way to handle exception by any means!!

Unicode error using PDO. Mysql Unicode problem

Are you having those ???? things on your webpage when something you entered on Mr mysql is unicode character?
Here is a fix for that

Assuming you are using PDO object in your Db Class..

$db = array containing information ....
$this->pdo = new PDO("mysql:host={$db['host']};dbname={$db['database']};charset=utf8", $db['username'], $db['password']);

Now the next task to to tell Mysql to honor unicodes:

$this->query('SET NAMES utf8');
$this->query('SET CHARACTER SET utf8');
$this->query('SET COLLATION_CONNECTION="utf8_general_ci"');

where your query function could look like

public function query($query, $params=array())
		if (!empty($this->pdo))
			catch(PDOException $exception)
				echo "error occured";
				//logit or whatever
		return $results;

Yea this would take care of the problem. There are certain things you have to do on the mysql database itself to handle unicode but I will not discuss those here
Hope it would help somebody..