【发布时间】:2015-04-10 01:34:15
【问题描述】:
我正在尝试使用 datatables.net 在我的网站上构建表格。我有一个使用他们的示例和 1 个表生成 OK 的基本表,但是我有一个包含连接、where 子句、子查询等的复杂查询,我不知道如何使用结果创建一个表。
他们的基本示例如下所示:
// DB table to use
$table = 'TableNameToQuery';
// Table's primary key
$primaryKey = 'pk';
最后是这个:
echo json_encode(
SSP::simple( $_GET, $sql_details, $table, $primaryKey, $columns )
MySQL 查询看起来类似于:
select t1.col1, col2, col3, col4 from table1 t1 left join table 2 t2 on t1.col1 = t2.col1 where t2.col5 = 'complete'
【问题讨论】:
-
该查询会是什么样子?
-
类似于:select t1.col1, col2, col3, col4 from table1 t1 left join table 2 t2 on t1.col1 = t2.col1 where t2.col5 = 'complete'跨度>
标签: php mysql datatables