回答編集履歴
1
加筆
test
CHANGED
@@ -1 +1,33 @@
|
|
1
1
|
単純にSQLでwhere句を利用していないからではないでしょうか?
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
```
|
6
|
+
|
7
|
+
$query = "select * from human"; //humanはカラム名
|
8
|
+
|
9
|
+
$result = mysqli_query($dbc,$query);
|
10
|
+
|
11
|
+
$data = mysqli_fetch_array($result);
|
12
|
+
|
13
|
+
```
|
14
|
+
|
15
|
+
を
|
16
|
+
|
17
|
+
```
|
18
|
+
|
19
|
+
$query = "select * from human where email = ?";
|
20
|
+
|
21
|
+
$stmt = mysqli_prepare($dbc, $query); // ステートメントの用意
|
22
|
+
|
23
|
+
mysqli_stmt_bind_param($stmt, 's', $email); // プリペアドステートメントのパラメータをバインド
|
24
|
+
|
25
|
+
mysqli_stmt_execute($stmt); // クエリ実行
|
26
|
+
|
27
|
+
$result = mysqli_stmt_get_result($stmt);
|
28
|
+
|
29
|
+
$data = mysqli_fetch_array($result);
|
30
|
+
|
31
|
+
```
|
32
|
+
|
33
|
+
のようにしたらどうでしょう?
|