如何使用Postgres Like
命令中的參數?瞭解PHP中Postgres Like命令中的參數
我在閱讀this document。 我正在搜索表questions
中的單詞lorem
以及其列body
。
我沒有成功運行下面的代碼PHP內
$result = pg_query_params ($dbconn,
"SELECT question_id, body
FROM questions
WHERE body ilike '%$1%'",
array ($_GET['search'])
);
我得到這樣的警告
Warning: pg_query_params() [function.pg-query-params]: Query failed: ERROR: bind message supplies 1 parameters, but prepared statement "" requires 0 in /var/www/codes/search_body.php on line 10 Call Stack
謝謝您的解答! –