teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

追記

2019/12/31 10:34

投稿

m.ts10806
m.ts10806

スコア80888

answer CHANGED
@@ -3,5 +3,7 @@
3
3
  ```
4
4
 
5
5
  ```php
6
- $sql='SELECT code,date,column1,column2,column3 FROM table WHERE (DATE_FORMAT(date, \'%Y%m\') = ' . $currentDate . ') ORDER BY code DESC';
6
+ $sql='SELECT code,date,column1,column2,column3 FROM table WHERE (DATE_FORMAT(date, \'%Y%m\') = \'' . $currentDate . '\') ORDER BY code DESC';
7
- ```
7
+ ```
8
+
9
+ 想定の情報がとれるか、SQLが正しいかは別として、Syntax取り除くだけならこう。