質問編集履歴

1

コードをつけたしました

2020/12/24 05:20

投稿

Gshehebnk
Gshehebnk

スコア3

test CHANGED
File without changes
test CHANGED
@@ -24,7 +24,7 @@
24
24
 
25
25
  $name = $_FILES['image']['name'];
26
26
 
27
- if (move_uploaded_file($_FILES['image']['tmp_name'], $name)) {
27
+ if ($filepass = move_uploaded_file($_FILES['image']['tmp_name'], $name)) {
28
28
 
29
29
  //echo $_FILES['image']['name'].'をアップロードしました';
30
30
 
@@ -42,7 +42,7 @@
42
42
 
43
43
 
44
44
 
45
- $sql = "INSERT INTO photo (name, type, filepass, created) VALUES (:image_name, :image_type, NOW())";
45
+ $sql = "INSERT INTO photo (name, type, filepass, created) VALUES (:image_name, :image_type, :image_filepass, NOW())";
46
46
 
47
47
 
48
48
 
@@ -52,13 +52,15 @@
52
52
 
53
53
 
54
54
 
55
+ //$params = array(':id' => '', ':name' => $name, 'type' => $type);
55
56
 
57
+
56
58
 
57
59
  $stmt->bindValue(':image_name', $name, PDO::PARAM_STR);
58
60
 
61
+ $stmt->bindValue(':image_filepass', $filepass, PDO::PARAM_STR);
62
+
59
63
  $stmt->bindValue(':image_type', $type, PDO::PARAM_STR);
60
-
61
-    //$stmt->bindValue(':image_filepass', $filepass, PDO::PARAM_STR);
62
64
 
63
65
  $stmt->execute();
64
66
 
@@ -73,6 +75,8 @@
73
75
 
74
76
 
75
77
  ?>
78
+
79
+
76
80
 
77
81
 
78
82