質問編集履歴

1

文法修正

2016/03/03 08:05

投稿

MarvelousMasa
MarvelousMasa

スコア16

test CHANGED
File without changes
test CHANGED
@@ -8,25 +8,25 @@
8
8
 
9
9
  $serchWord = explode(' ', str_replace(' ', ' ', $serchWord));
10
10
 
11
- $where .="AND(";
11
+ $wordlist .="AND(";
12
12
 
13
13
  $i = 0;
14
14
 
15
- foreach ($wordlist as $serchWord) {
15
+ foreach ($serchWord as $word) {
16
16
 
17
- $where .= "search_words LIKE '%" . $serchWord . "%' ";
17
+ $wordlist .= "search_words LIKE '%" . $word . "%' ";
18
18
 
19
19
  $i ++;
20
20
 
21
- if($i < count($wordlist)) {
21
+ if($i < count($serchWord)) {
22
22
 
23
- $where .= "and ";
23
+ $wordlist .= "and ";
24
24
 
25
25
  }
26
26
 
27
27
  }
28
28
 
29
- $where .=")";
29
+ $wordlist .=")";
30
30
 
31
31
  }
32
32