PHP数据表查询
我刚刚开始使用jQuery/PHP数据表插件。我可以很容易地执行一些查询,例如PHP数据表查询,php,jquery,postgresql,datatables,Php,Jquery,Postgresql,Datatables,我刚刚开始使用jQuery/PHP数据表插件。我可以很容易地执行一些查询,例如 $dt = new DataTables(); $dt->setTable(array( 'select' => 'n.request_id, n.type_name, n.request_date, n.initiator, n.target_customer, n.agent_number, n.merchant_number, n.bill_reference, n.amou
$dt = new DataTables();
$dt->setTable(array(
'select' => 'n.request_id, n.type_name, n.request_date, n.initiator, n.target_customer, n.agent_number, n.merchant_number, n.bill_reference, n.amount',
'from' => 'approvals n'
));
$dt->andWhere("n.customer_id", "{$_SESSION['customer_id']}");
我想知道的是如何执行更多的查询,例如传递SQL或语句,甚至传递要在WHERE语句中使用的PHP数组以进行比较,就像我在SQL like中所做的那样:
SELECT * FROM table WHERE id IN (1, 3, 6)
或
我认为
其中id=3或id=4
与其中id在(3,4)
中是一样的,是吗?是的,它们实际上是相同的,但我需要将其放在上面的datatables格式中。您使用什么库进行服务器端处理?@Ravi不太确定,因为我学了一些工作……还有其他方法可以帮助您吗?您可以阅读datatables
类及其函数。可能有类似于$dt->orWhere
或$dt->orWhere_的函数。查看库的源代码
SELECT * FROM table WHERE id=3 OR id=4