几个字段中的一个在jQuery $.get()中返回“null”


One field out of several returns "null" in jQuery $.get()

出于某种原因,'price' 返回 null,而所有其他都不是问题。知道为什么会这样吗?

MySQL:

名为"夜晚"的

表,其中的列称为"名称"、"价格"、"白天"、"排队跳跃"、"关闭"和"门"。它们都已填充。

活动信息.php:

<?php
header('Cache-Control: no-cache, must-revalidate');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Content-type: application/json');
include('functions.php');
connect();
$night = $_POST['club'];
$night = mysql_real_escape_string($night);
$query = "SELECT * FROM nights WHERE name = '" .$night. "'";
    $result = mysql_query($query);
    $items = array();
    if($result && mysql_num_rows($result) > 0) { 
        while ($row = mysql_fetch_array($result)) { 
        $items[] = array("price"=>$row['price'], "day"=>getLongDateString($row['day']), "queuejump"=>$row['queue jump'], "closing"=>$row['closing']);
        }
    } 
    mysql_close(); 
    // convert into JSON format and print
    echo json_encode($items);
?>

.JS:

<script type="text/javascript">
    $(document).ready(function() {
            $('#right_inside').html('<h2>' + $('#club').val() + '</h2>');
    });
    $('#club').change(function(event) {
        $.ajax({
            type: "post",
            url: "eventinfo.php",
            data:  $(this).serialize(),
            success: function(data) {
                $('#right_inside').html('<h2>' + $('#club').val() + '<span style="font-size: 14px"> (' + data[0].day + ')</h2><p>Entry: ' + data[0].price + '</p><p>Queue jump: ' + data[0].queuejump + '</p><p>Guestlist closes at ' + data[0].closing + '</p>');
alert(JSON.stringify(data));
                },
            dataType: "json"
        });
    });
</script>
设法

解决这个问题 - MySQL不喜欢£符号。 &pound;&#163;效果更好。