回答編集履歴
1
修正
answer
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
if (!empty(filter_input(INPUT_POST, 'name'))) {
|
9
9
|
$name = filter_input(INPUT_POST, 'name');
|
10
10
|
try {
|
11
|
-
$pdo = new PDO('mysql:host=localhost;dbname=
|
11
|
+
$pdo = new PDO('mysql:host=localhost;dbname=test;charset=utf8', 'root', 'password');
|
12
12
|
$stmt = $pdo->prepare('SELECT * FROM `name` WHERE `name` = :name');
|
13
13
|
$stmt->bindParam(':name', $name);
|
14
14
|
$stmt->execute();
|