小编STi*_*KED的帖子

如何使用ssp.class.php DataTables使用'WHERE'子句

好的,所以我试图使用jQuery DataTable(DataTables.net)显示来自我的数据库的信息.我可以让它工作得很好,显示整个表'笔记',但我想只显示未读取的笔记.所以我需要以某种方式包含一个WHERE子句,但我不清楚最好的方法来解决这个问题.

这是我目前显示整个表格的方式:

// DB table to use
$table = 'Notes';

// Table's primary key
$primaryKey = 'CID';

// Array of database columns which should be read and sent back to DataTables.
// The `db` parameter represents the column name in the database, while the `dt`
// parameter represents the DataTables column identifier. In this case simple
// indexes
$columns = array(
array( 'db' => 'CID', 'dt' => 0 ),

array(
    'db'        => 'CID',
    'dt'        => 0,
    'formatter' => function( …
Run Code Online (Sandbox Code Playgroud)

php mysql sql jquery jquery-datatables

15
推荐指数
2
解决办法
2万
查看次数

标签 统计

jquery ×1

jquery-datatables ×1

mysql ×1

php ×1

sql ×1