$value){ $wordlist[$arrlength]=$word; $arrlength++; } */ $arrlength=count($wordlist); echo ""; $db_path=$dictDir; $db_file = $db_path.$dictFileName; //open database PDO_Connect("sqlite:$db_file"); global $PDO; for($x=0;$x<$arrlength;$x++){ if(mb_strlen($wordlist[$x]->word)>1){ //直接查 if($dictFileName=="wbw"){ if($wordlist[$x]->level==1){ $query = "select * from dict where \"type\"<> \"pali\"=".$PDO->quote($wordlist[$x]->word)." AND ( type <> '.n.' AND type <> '.ti.' AND type <> '.adj.' AND type <> '.pron.' AND type <> '.v.' ) ORDER BY rowid DESC"; } else{ $query = "select * from dict where \"pali\"=".$PDO->quote($wordlist[$x]->word)." ORDER BY rowid DESC"; } } else{ if($wordlist[$x]->level==1){ $query = "select * from dict where \"pali\"=".$PDO->quote($wordlist[$x]->word)." AND ( type <> '.n.' AND type <> '.ti.' AND type <> '.adj.' AND type <> '.pron.' AND type <> '.v.' )"; } else{ $query = "select * from dict where \"pali\"=".$PDO->quote($wordlist[$x]->word).""; } } $Fetch = PDO_FetchAll($query); $iFetch=count($Fetch); if($iFetch>0){ for($i=0;$i<$iFetch;$i++){ $outXml = ""; $outXml .= "".$Fetch[$i]["id"].""; if(isset($Fetch[$i]["guid"])){$outXml .= "".$Fetch[$i]["guid"]."";}else{$outXml .= "";} $outXml .= "".$Fetch[$i]["pali"].""; $outXml .= "".$Fetch[$i]["type"].""; $outXml .= "".$Fetch[$i]["gramma"].""; $outXml .= "".$Fetch[$i]["parent"].""; $outXml .= "".$Fetch[$i]["mean"].""; $outXml .= "".$Fetch[$i]["factors"].""; if(isset($Fetch[$i]["part_id"])){$outXml .= "".$Fetch[$i]["part_id"]."";}else{$outXml .= "";} $outXml .= "".$Fetch[$i]["factormean"].""; if(isset($Fetch[$i]["note"])){ $outXml .= "".$Fetch[$i]["note"].""; } else{ $outXml .= ""; } if(isset($Fetch[$i]["status"])){ $outXml .= "".$Fetch[$i]["status"].""; } else{ $outXml .= "256"; } if(isset($Fetch[$i]["enable"])){ $outXml .= "".$Fetch[$i]["enable"].""; } else{ $outXml .= "TURE"; } if(isset($Fetch[$i]["dict_name"])){ $outXml .= "".$Fetch[$i]["dict_name"].""; } else{ $outXml .= "unkow"; } if(isset($Fetch[$i]["language"])){ $outXml .= "".$Fetch[$i]["language"].""; } else{ $outXml .= "en"; } if(isset($Fetch[$i]["time"])){ $outXml .= ""; } else{ $outXml .= ""; } $outXml .= ""; echo $outXml; } } /*直接查询结束*/ } } $outXml = ""; echo $outXml; //fwrite($fpTemp, $outXml); //fclose($fpTemp); //$fpTemp = fopen($tempFile, "r") or die("Unable to open file!"); //$tempText = fread($fpTemp,filesize($tempFile)); //fclose($fpTemp); //echo $tempText; ?>