OpenJs Grid mysql

时间:2012-11-21 19:06:19

标签: php mysql

我尝试使用OpenJs Grid访问mysql表。 如果数据库" partsdb"我已经进行了双重检查。和表"部分"存在,可以从命令行访问它。

目前我使用必须的基本示例:

members.php:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Members Page</title>
<script>
$(function() {
    $(".parts").grid();
});
</script>

</head>
<body>

<div id="container">
    <h1>Members Page</h1>

    <table action="ajax.php">
        <tr>
            <th col="id">Id</th>
            <th col="name">Name</th>
        </tr>
    </table>

    <a href='<?php echo base_url()."main/logout" ?>'>Logout</a>
</div>

   

和ajax.php

<?php
mysql_connect("localhost","****","*****");
mysql_select_db("partsdb");

require_once("grid.php");

$grid = new Grid("parts");


?>

当我直接在ajax.php上运行php时,我收到一个错误告诉我:&#34;未知的列&#39;部分。&#39;在&#39;字段列表&#39; &#34;并且该表仅显示标题。

我做错了什么?

1 个答案:

答案 0 :(得分:0)

变化

<table action="ajax.php">

<table class="grid parts" action="ajax.php">

看看是否有帮助:)