0
我用不用彷徨從DB.get jquery返回「數組」字符串?
$.get("script/get_words.php", function(data) {
alert(data);
words = data;
$.each(words, function(k, v) {
availableTags[k] = v;
})
});
$("#tags").autocomplete({
source: availableTags
});
這個取字的列表是在get_words.php請求我打電話
$sql = "select answer from questions";
$words = array();
$result = run_query($sql);
$i = 0;
// echo "1 $course_is is course_id and $class_id is class_id <br>" ;
while ($row = mysql_fetch_assoc($result)) {
$words[$i] = $row['answer'];
//echo $words[$i];
$i++;
}
return $words;
它返回僅單詞的問題PHP數組,而不是我要求的文字列表 可能的解決方案是什麼?
我得到單詞thx,現在檢查其他東西 – mfadel 2012-04-26 13:04:03