回答編集履歴
1
PDO側のエラーハンドリング設定を追記
test
CHANGED
@@ -17,3 +17,21 @@
|
|
17
17
|
[http://php.net/manual/ja/function.error-reporting.php](http://php.net/manual/ja/function.error-reporting.php)
|
18
18
|
|
19
19
|
[http://php.net/manual/ja/errorfunc.configuration.php#ini.display-errors](http://php.net/manual/ja/errorfunc.configuration.php#ini.display-errors)
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
上に加えて、TaMaMhyu様の回答の通り、`PDO`のエラーハンドリング設定も加えて下さい。
|
24
|
+
|
25
|
+
```php
|
26
|
+
|
27
|
+
$dbh=new PDO($dsn, $user, $password);
|
28
|
+
|
29
|
+
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING); // この1行を追加
|
30
|
+
|
31
|
+
$dbh->query('SET NAMES utf8');
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
...
|
36
|
+
|
37
|
+
```
|