質問編集履歴
3
文法修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -36,7 +36,7 @@
|
|
36
36
|
|
37
37
|
$num = htmlspecialchars($_GET["id"]);
|
38
38
|
|
39
|
-
$pdo = new PDO('mysql:dbname=
|
39
|
+
$pdo = new PDO('mysql:dbname=staff_manager;host=localhost;charset=utf8', 'user', 'passwar');
|
40
40
|
|
41
41
|
$stmt = $pdo->prepare("select name,class,birth from staff_master where ID = $num");
|
42
42
|
|
2
ファイル追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
ここからどのようにすれば初期値で入りますか?
|
6
6
|
|
7
|
-
|
7
|
+

|
8
8
|
|
9
9
|
```php
|
10
10
|
|
1
ファイル名追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -4,7 +4,67 @@
|
|
4
4
|
|
5
5
|
ここからどのようにすれば初期値で入りますか?
|
6
6
|
|
7
|
+
|
8
|
+
|
7
9
|
```php
|
10
|
+
|
11
|
+
<!DOCTYPE html>
|
12
|
+
|
13
|
+
<html lang="ja">
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
<head>
|
18
|
+
|
19
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
20
|
+
|
21
|
+
<title>change</title>
|
22
|
+
|
23
|
+
</head>
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
<body>
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
<h2>登録情報変更</h2>
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
<?php
|
36
|
+
|
37
|
+
$num = htmlspecialchars($_GET["id"]);
|
38
|
+
|
39
|
+
$pdo = new PDO('mysql:dbname=dbname;host=localhost;charset=utf8', 'user', 'passwar');
|
40
|
+
|
41
|
+
$stmt = $pdo->prepare("select name,class,birth from staff_master where ID = $num");
|
42
|
+
|
43
|
+
$stmt->execute();
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
?>
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
<form action="chan_ch.php" method="get" style="display: inline">
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
<table>
|
60
|
+
|
61
|
+
<tr><td>社員NO</td><td><?php echo $_GET['id']; ?></td></tr>
|
62
|
+
|
63
|
+
<tr><td>氏名</td><td><input type="text" name="n_name" value="<?php echo $result['name'] ?>" /></td></tr>
|
64
|
+
|
65
|
+
<tr><td>所属</td><td><input type="text" name="n_class" value="<?php echo $result['class'] ?>" /></td></tr>
|
66
|
+
|
67
|
+
<tr><td>生年月日</td><td>
|
8
68
|
|
9
69
|
<?php
|
10
70
|
|
@@ -48,4 +108,24 @@
|
|
48
108
|
|
49
109
|
?>
|
50
110
|
|
111
|
+
|
112
|
+
|
113
|
+
</td></tr>
|
114
|
+
|
115
|
+
</table>
|
116
|
+
|
117
|
+
<input type="submit" value="確認" />
|
118
|
+
|
119
|
+
<input type="button" onClick="location.href='master.php'" value="キャンセル" />
|
120
|
+
|
121
|
+
</form>
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
</body>
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
</html>
|
130
|
+
|
51
131
|
```
|