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

質問編集履歴

1

文法修正

2016/03/03 08:05

投稿

MarvelousMasa
MarvelousMasa

スコア16

title CHANGED
File without changes
body CHANGED
@@ -3,15 +3,15 @@
3
3
  ```
4
4
  if ( $serchWord != '' ) {
5
5
  $serchWord = explode(' ', str_replace(' ', ' ', $serchWord));
6
- $where .="AND(";
6
+ $wordlist .="AND(";
7
7
  $i = 0;
8
- foreach ($wordlist as $serchWord) {
8
+ foreach ($serchWord as $word) {
9
- $where .= "search_words LIKE '%" . $serchWord . "%' ";
9
+ $wordlist .= "search_words LIKE '%" . $word . "%' ";
10
10
  $i ++;
11
- if($i < count($wordlist)) {
11
+ if($i < count($serchWord)) {
12
- $where .= "and ";
12
+ $wordlist .= "and ";
13
13
  }
14
14
  }
15
- $where .=")";
15
+ $wordlist .=")";
16
16
  }
17
17
  ```