Javascript 我无法获取显示mySql数据的Slickgrid

Javascript 我无法获取显示mySql数据的Slickgrid,javascript,php,jquery,mysql,slickgrid,Javascript,Php,Jquery,Mysql,Slickgrid,当我运行它时,它只显示html表。我哪里做错了。我尝试了很多例子,但都没有成功,上周我在网上读了尽可能多的书。我认为php数组没有正确地传递给javascript。先谢谢你 伊蒙·伯恩 <html> <head> <title>Php using database</title> <link rel="stylesheet" href="css/slick.grid.css" type="text/c

当我运行它时,它只显示html表。我哪里做错了。我尝试了很多例子,但都没有成功,上周我在网上读了尽可能多的书。我认为php数组没有正确地传递给javascript。先谢谢你

伊蒙·伯恩

<html>

    <head>
        <title>Php using database</title>
        <link rel="stylesheet" href="css/slick.grid.css" type="text/css" media="screen" charset="utf-8" />
        <link rel="stylesheet" href="css/smoothness/jquery-ui-1.8.5.custom.css" type="text/css" media="screen" charset="utf-8" />
        <link rel="stylesheet" href="css/examples.css" type="text/css" media="screen" charset="utf-8" />
    </head>

    <body>
        <center>
             <h1>Database Connection</h1>

        </center>
        <?php include( 'inc/dbConnect.php'); ?>
        <?php connectDB(); $i=0; $query="SELECT media_id, name, location, jobs_day, phone FROM allprintmedia" ; $result=m ysql_query($query) or die( "Query failed"); $array=m ysql_fetch_array($result) ; ?>
        <div id="table_admin" class="span7">
             <h3>Print Media</h3>

            <table border="1" class="table" id="media">
                <thead>
                    <tr>
                        <th>ID</th>
                        <th>Name</th>
                        <th>Location</th>
                        <th>Day</th>
                        <th>Phone</th>
                    </tr>
                </thead>
                <?php $count=0; while ($row=m ysql_fetch_array($result)) { $arr[$count]=$ row; $count++; echo "<TR>"; echo "<TD>", $row[ 'media_id'], "  </TD><TD>", $row[ 'name'], "  </TD><TD>", $row[ 'location'], "  </TD><TD>", $row[ 'jobs_day'], "  </TD><TD>", $row[ 'phone'], "<tr>"; echo "</TR>"; } ?>
                <script src="js/jquery-1.10.2.min.js"></script>
                <script src="js/jquery.event.drag-2.0.min.js"></script>
                <script src="js/slick.core.js"></script>
                <script src="js/slick.grid.js"></script>
                <script>
                    $(document).ready(function() {
                        var oTable = $('#media').jquery.dataTable;
                        $('td', oTable.fnGetNodes()).jquery.editable('php/editable_ajax.php', {
                            "callback": function(xValue, y) {
                                var aPos = oTable.fnGetPosition(this);
                                oTable.fnUpdate(sValue, aPos[0], aPos[1]);
                            },
                                "submitdata": function(value, settings) {
                                return {
                                    "row_id": this.parentNode.getAttribute('id'),
                                        "column": oTable.fnGetPosition(this)[2]
                                };
                            },
                                "height": "14px"
                        });
                    });
                </script>
                </thead>
    </body>

</html>

Php使用数据库
数据库连接
印刷媒体
身份证件
名称
位置
白天
电话
$(文档).ready(函数(){
var-oTable=$('#media').jquery.dataTable;
$('td',oTable.fnGetNodes()).jquery.editable('php/editable_ajax.php'{
“回调”:函数(xValue,y){
var aPos=可旋转的.fGetPosition(此);
fnUpdate(sValue,aPos[0],aPos[1]);
},
“提交数据”:功能(值、设置){
返回{
“row_id”:this.parentNode.getAttribute('id'),
“列”:oTable.fGetPosition(本)[2]
};
},
“高度”:“14px”
});
});

首先,请不要使用mysql\u query(),因为它已经。。。而是使用或-这些链接将带您到一些教程

<?php connectDB(); $i=0; $query="SELECT media_id, name, location, jobs_day, phone FROM allprintmedia" ; $result=m ysql_query($query) or die( "Query failed"); $array=m ysql_fetch_array($result) ; ?>

<?php $count=0; while ($row=m ysql_fetch_array($result)) { $arr[$count]=$ row; $count++; echo "<TR>"; echo "<TD>", $row[ 'media_id'], "  </TD><TD>", $row[ 'name'], "  </TD><TD>", $row[ 'location'], "  </TD><TD>", $row[ 'jobs_day'], "  </TD><TD>", $row[ 'phone'], "<tr>"; echo "</TR>"; } ?>
你有:

$result=m ysql_query($query)

这是所有的外观。这可能是打字错误吗?

复制代码时出错。我查过了。
$result=m ysql_query($query)