回答編集履歴
3
修正
test
CHANGED
@@ -28,7 +28,7 @@
|
|
28
28
|
|
29
29
|
$link = mysqli_connect($host, $user, $password, $database);
|
30
30
|
|
31
|
-
mysqli_select_db($link,
|
31
|
+
//mysqli_select_db($link, database);
|
32
32
|
|
33
33
|
|
34
34
|
|
2
修正
test
CHANGED
@@ -1,3 +1,51 @@
|
|
1
|
+
```php
|
2
|
+
|
1
|
-
|
3
|
+
<?php
|
2
4
|
|
3
5
|
|
6
|
+
|
7
|
+
$name = filter_input(INPUT_POST, 'name');
|
8
|
+
|
9
|
+
$tel = filter_input(INPUT_POST, 'tel');
|
10
|
+
|
11
|
+
$email = filter_input(INPUT_POST, 'email');
|
12
|
+
|
13
|
+
$course = filter_input(INPUT_POST, 'course');
|
14
|
+
|
15
|
+
$time = filter_input(INPUT_POST, 'time');
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
$host = 'localhost';
|
20
|
+
|
21
|
+
$database = 'test';
|
22
|
+
|
23
|
+
$user = 'root';
|
24
|
+
|
25
|
+
$password = 'password';
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
$link = mysqli_connect($host, $user, $password, $database);
|
30
|
+
|
31
|
+
mysqli_select_db($link, $password);
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
$sql = "INSERT INTO test (`name`, `tel`, `email`, `course`, `time`) VALUES (?, ?, ?, ?, ?)";
|
36
|
+
|
37
|
+
$stmt = mysqli_prepare($link, $sql);
|
38
|
+
|
39
|
+
mysqli_stmt_bind_param($stmt, "sssss", $name, $tel, $email, $course, $time);
|
40
|
+
|
41
|
+
$stmt->execute();
|
42
|
+
|
43
|
+
mysqli_stmt_execute($stmt);
|
44
|
+
|
45
|
+
mysqli_close($link);
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
```
|
50
|
+
|
51
|
+
|
1
shuusei
test
CHANGED
@@ -1 +1,3 @@
|
|
1
|
-
![イメージ説明](b
|
1
|
+
![イメージ説明](939b06d1117759cb6d707448b93820c4.png)
|
2
|
+
|
3
|
+
|