<?php

$hata = $db -> prepare('insert...');
if (!$hata) {
    print_r($db->errorInfo());
}
?>