Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/251.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP数据表查询_Php_Jquery_Postgresql_Datatables - Fatal编程技术网

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

我刚刚开始使用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.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