Javascript 使用X-editable和Bootstrap写入Mysql数据库

Javascript 使用X-editable和Bootstrap写入Mysql数据库,javascript,php,jquery,mysql,twitter-bootstrap,Javascript,Php,Jquery,Mysql,Twitter Bootstrap,我正试图为我的小办公室建一个小数据库。我正在使用x-editable plugin for bootstrap来编辑live my字段,但我找不到错误在哪里,除了更新数据库的部分之外,其他一切似乎都正常工作。我省略了表前面的查询部分,这在这里并不重要,因为结果都正确地显示在表中 这是桌子 echo'<tr class="'.$class.'"> <td class="xedit" id="id-'.$fetch['id'].'"

我正试图为我的小办公室建一个小数据库。我正在使用x-editable plugin for bootstrap来编辑live my字段,但我找不到错误在哪里,除了更新数据库的部分之外,其他一切似乎都正常工作。我省略了表前面的查询部分,这在这里并不重要,因为结果都正确地显示在表中

这是桌子

echo'<tr class="'.$class.'">
                        <td class="xedit" id="id-'.$fetch['id'].'" data-pk="'.$fetch['id'].'"data-name="id">'.$fetch['id'].'</td>                       
                        <td class="xedit" id="status-'.$fetch['id'].'"data-pk="'.$fetch['id'].'"data-name="status">'.$status_output.'</td>  
                        <td class="xedit" id="pc-'.$fetch['id'].'" data-pk="'.$fetch['id'].'" data-name="pc">'.$fetch['pc'].'</td>
                        <td class="xedit" id="nome-'.$fetch['id'].'"data-pk="'.$fetch['id'].'" data-name="nome">'.$fetch['nome'].'</td>
                        <td class="xedit" id="cognome-'.$fetch['id'].'"data-pk="'.$fetch['id'].'"data-name="cognome">'.$fetch['cognome'].'</td>
                        <td class="xedit" id="email_new-'.$fetch['id'].'"data-pk="'.$fetch['id'].'"data-name="email_new">'.$fetch['email_new'].'</td>
                        <td class="xedit" id="email_pwd-'.$fetch['id'].'"data-pk="'.$fetch['id'].'"data-name="email_pwd">'.$fetch['email_pwd'].'</td>
                        <td class="xedit" id="interno-'.$fetch['id'].'"data-pk="'.$fetch['id'].'"data-name="interno">'.$fetch['interno'].'</td>
                        <td class="xedit" id="ip-'.$fetch['id'].'"data-pk="'.$fetch['id'].'"data-name="ip">'.$fetch['ip'].'</td>
                        <td class="xedit" id="ip_vpn-'.$fetch['id'].'"data-pk="'.$fetch['id'].'"data-name="ip_vpn">'.$fetch['ip_vpn'].'</td>
                        <td class="xedit" id="dc_user-'.$fetch['id'].'"data-pk="'.$fetch['id'].'"data-name="dc_user">'.$fetch['dc_user'].'</td>
                        <td class="xedit" id="dc_pwd-'.$fetch['id'].'"data-pk="'.$fetch['id'].'"data-name="dc_pwd">'.$fetch['dc_pwd'].'</td>
                        <td class="xedit" id="utenti_notes-'.$fetch['id'].'" data-pk="'.$fetch['id'].'"data-name="utenti_notes">'.$fetch['utenti_notes'].'</td>
                        <td><a href="delete.php?del=<?php echo $user_id ?>"><button type="button" class="btn btn-default btn-xs">
                                <span class="glyphicon glyphicon-remove-circle" aria-hidden="true"></span></button></a></td>

                        </tr>';         
}))

这是server_processing.php页面,对我来说似乎是正确的,但数据库并没有更新。重新加载页面后,提交的值将消失

    <?php
include("connect.php");
$pk = $_POST['pk'];
$name = $_POST['name'];
$value = $_POST['value'];
if ( mysql_query("update utenti set $name='$value' where id='$pk'") ) {
    print_r($_POST);
}
?>
a)您容易受到b)您完全没有错误处理能力,只是假设您的查询不会出错。;a) 这是一个封闭vlan中本地机器上的db,这没有问题,但我将在这个问题中进行更深入的研究。b) 查询就像$query=mysql\u query(“SELECT*FROM users”)一样简单;无论如何,我已经解决了这个问题,谢谢。
    <?php
include("connect.php");
$pk = $_POST['pk'];
$name = $_POST['name'];
$value = $_POST['value'];
if ( mysql_query("update utenti set $name='$value' where id='$pk'") ) {
    print_r($_POST);
}
?>