回答編集履歴
2
URLをリンクしました。
test
CHANGED
@@ -78,7 +78,7 @@
|
|
78
78
|
|
79
79
|
※参考
|
80
80
|
|
81
|
-
https://www.php.net/manual/ja/language.types.string.php#language.types.string.syntax.double
|
81
|
+
[https://www.php.net/manual/ja/language.types.string.php#language.types.string.syntax.double](https://www.php.net/manual/ja/language.types.string.php#language.types.string.syntax.double)
|
82
82
|
|
83
83
|
|
84
84
|
|
@@ -128,7 +128,7 @@
|
|
128
128
|
|
129
129
|
※参考
|
130
130
|
|
131
|
-
https://www.php.net/manual/ja/function.sprintf.php
|
131
|
+
[https://www.php.net/manual/ja/function.sprintf.php](https://www.php.net/manual/ja/function.sprintf.php)
|
132
132
|
|
133
133
|
|
134
134
|
|
@@ -140,6 +140,6 @@
|
|
140
140
|
|
141
141
|
※参考
|
142
142
|
|
143
|
-
https://www.php.net/manual/ja/pdo.prepared-statements.php
|
143
|
+
[https://www.php.net/manual/ja/pdo.prepared-statements.php](https://www.php.net/manual/ja/pdo.prepared-statements.php)
|
144
144
|
|
145
|
-
https://www.php.net/manual/ja/pdo.prepare.php
|
145
|
+
[https://www.php.net/manual/ja/pdo.prepare.php](https://www.php.net/manual/ja/pdo.prepare.php)
|
1
※sprintf()の書き漏れを訂正
test
CHANGED
@@ -112,7 +112,15 @@
|
|
112
112
|
|
113
113
|
$sql = "INSERT INTO memos SET memo='%s',created_at=%s";
|
114
114
|
|
115
|
+
$db->exec(sprintf($sql, $memo, 'now()'));
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
※sprintf()の書き漏れを訂正[2/16 14:40]
|
120
|
+
|
115
|
-
$db->exec($sql, $memo, 'now()');
|
121
|
+
前:$db->exec($sql, $memo, 'now()');
|
122
|
+
|
123
|
+
後:$db->exec(sprintf($sql, $memo, 'now()'));
|
116
124
|
|
117
125
|
```
|
118
126
|
|