>>487
DBの接続は何を使ってる?
PDOならこんな感じ

try{
// クエリを発行
} catch (PDOException $e){
// エラー処理
}