質問編集履歴
1
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -45,3 +45,53 @@
|
|
45
45
|
|
46
46
|
|
47
47
|
```
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
追記
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
使用用途ですが、下記の様な事をしようと考えていました。
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
参照
|
60
|
+
|
61
|
+
https://www.php.net/manual/ja/mysqli.real-escape-string.php
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
```php
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
//初期化
|
70
|
+
|
71
|
+
$DB_CONNECTION = "mysql";
|
72
|
+
|
73
|
+
$DB_HOST = "127.0.0.1";
|
74
|
+
|
75
|
+
$DB_PORT = "3306";
|
76
|
+
|
77
|
+
$DB_DATABASE = "cms_03";
|
78
|
+
|
79
|
+
$DB_USERNAME = "root";
|
80
|
+
|
81
|
+
$DB_PASSWORD = "pass";
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
//値取得
|
86
|
+
|
87
|
+
$mysqli = new mysqli($DB_HOST, $DB_USERNAME, $DB_PASSWORD, $DB_DATABASE);
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
//エスケープ処理
|
92
|
+
|
93
|
+
$string = $mysqli->real_escape_string($string);
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
```
|