回答編集履歴
1
PDO側のエラーハンドリング設定を追記
answer
CHANGED
@@ -7,4 +7,13 @@
|
|
7
7
|
```
|
8
8
|
|
9
9
|
[http://php.net/manual/ja/function.error-reporting.php](http://php.net/manual/ja/function.error-reporting.php)
|
10
|
-
[http://php.net/manual/ja/errorfunc.configuration.php#ini.display-errors](http://php.net/manual/ja/errorfunc.configuration.php#ini.display-errors)
|
10
|
+
[http://php.net/manual/ja/errorfunc.configuration.php#ini.display-errors](http://php.net/manual/ja/errorfunc.configuration.php#ini.display-errors)
|
11
|
+
|
12
|
+
上に加えて、TaMaMhyu様の回答の通り、`PDO`のエラーハンドリング設定も加えて下さい。
|
13
|
+
```php
|
14
|
+
$dbh=new PDO($dsn, $user, $password);
|
15
|
+
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING); // この1行を追加
|
16
|
+
$dbh->query('SET NAMES utf8');
|
17
|
+
|
18
|
+
...
|
19
|
+
```
|