Jelajahi Sumber

:bug: $Fetch提到开始避免查不到数据报错

visuddhinanda 4 tahun lalu
induk
melakukan
411949d529
1 mengubah file dengan 2 tambahan dan 3 penghapusan
  1. 2 3
      app/search/paliword_sc_pre.php

+ 2 - 3
app/search/paliword_sc_pre.php

@@ -12,7 +12,7 @@ $arrWordList = str_getcsv($word, " ");
 
 $searching = $arrWordList[count($arrWordList) - 1];
 PDO_Connect(_FILE_DB_WORD_INDEX_,_DB_USERNAME_,_DB_PASSWORD_);
-$Fetch = [];
+
 if (count($arrWordList) > 1) {
     //echo "<div>";
     foreach ($arrWordList as $oneword) {
@@ -29,6 +29,5 @@ if (count($arrWordList) > 1) {
             $Fetch[] = $value;
         }
     }
-    
+    echo json_encode($Fetch, JSON_UNESCAPED_UNICODE);
 }
-echo json_encode($Fetch, JSON_UNESCAPED_UNICODE);