我的magicSuggest插件有问题。我尝试使用magicSuggest显示数据库中的所有电子邮件地址,但输出列表变为空。
来自create_event.php
<script>
$('#ms-allowFreeEntries').magicSuggest({
placeholder : "Select" ,
data : "email.php"
});
</script>
来自email.php
<?php
include('includes/config.php');
include('includes/db.php');
include('includes/functions.php');
$result = $db->query("select `email` from `users");
$rows = array();
while($row = $result->fetch_array(MYSQL_ASSOC)) {
$rows[] = array_map("utf8_encode", $row);
}
echo json_encode($rows);
$result->close();
$db->close();
?>
来自的图片
output