回答編集履歴
1
追記
test
CHANGED
@@ -13,3 +13,35 @@
|
|
13
13
|
そもそもPOSTの値が`$firstnam`などの変数に入ってないように見えますが・・
|
14
14
|
|
15
15
|
あとユーザーからの入力値はそのままDBへ登録するのは基本的にNGです
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
【追記】
|
22
|
+
|
23
|
+
書くとしたらこうかなと
|
24
|
+
|
25
|
+
```.php
|
26
|
+
|
27
|
+
$stmt = $db->prepare("INSERT INTO users(firstname,lastname,email,phone,birthdate,username,password) VALUES (:firstname, :lastname, :email, :phone, :birthdate, :username, :password)");
|
28
|
+
|
29
|
+
$stmt->execute(array(
|
30
|
+
|
31
|
+
':firstname' => $firstname,
|
32
|
+
|
33
|
+
':lastname' => $lastname,
|
34
|
+
|
35
|
+
':email' => $email,
|
36
|
+
|
37
|
+
':phone' => $phone,
|
38
|
+
|
39
|
+
':birthdate' => $birthdate,
|
40
|
+
|
41
|
+
':username' => $username,
|
42
|
+
|
43
|
+
':password' => $password,
|
44
|
+
|
45
|
+
));
|
46
|
+
|
47
|
+
```
|