I'm using PHP and PDO. Now I want to build a kind of log when things go wrong. What can go wrong with PDO?
Right now I have these tests:
Connection test
try {
$this->pdo = new PDO($dsn, $credentials['user'], $credentials['pass'], $options);
} catch(Exception $e) {
$this->file->put( date('Y-m-d') . '.txt', 'log', 'Database error');
}
Execute test
try {
$stmt->execute();
} catch(Exception $e) {
$this->error->log('SQL', 'query error');
}
Any more tests that are good?