使用PHP

时间:2017-06-13 16:39:45

标签: php postgresql

此代码在PGAdmin上输出预期结果

select * from reports where manifesto_id = ' ' order by report_id

但是当我使用像这样的PHP pg_query_params运行它时

pg_query_params($connection,'select * from reports where manifesto_id = $1 order by report_id',array(' '));

我收到错误

  

PHP Parse错误:语法错误,意外''按report_id排序''(T_CONSTANT_ENCAPSED_STRING),期待','或')'

我尝试过使用manifesto_id为Null,但显然是

' ' != Null 

所以我没有得到预期的结果。有什么帮助吗?

0 个答案:

没有答案