Bug #76012 [Opn->Fbk]: "Invalid parameter number" error for simple query without placeholder

From: Date: Tue, 28 Sep 2021 10:49:07 +0000
Subject: Bug #76012 [Opn->Fbk]: "Invalid parameter number" error for simple query without placeholder
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-236888@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=76012&edit=1 ID: 76012 Updated by: cmb@php.net Reported by: young dot inbox at gmail dot com Summary: "Invalid parameter number" error for simple query without placeholder -Status: Open +Status: Feedback Type: Bug Package: PDO PgSQL Operating System: Ubuntu 14 LTS PHP Version: 7.2.2 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: If this is still an issue with any of the actively supported PHP versions[1], could you please make 2.sql available for download again? [1] <https://www.php.net/supported-versions.php> Previous Comments: ------------------------------------------------------------------------ [2018-02-26 16:23:10] young dot inbox at gmail dot com Description: ------------ The simple query like SELECT attribute7 FROM spot2d.client_tt WHERE attribute7 IN (list of values) which doesn't not contain any placeholders give error PDO::query(): SQLSTATE[HY093]: Invalid parameter number: mixed named and positional parameters While PostgreSQL run this query without any errors root@spot2dtest:/home/young# psql -h pgdev.spot2d.com -U dev ddc_scj < 2.sql Password for user dev: attribute7 ------------ (0 rows) If you will remove 10-20 values from any place of the list or some symbols (like ? in the middle of string) - it works all strings quoted with PDO::quote table content doesn't matter and it can even no exist Here is the 2.sql file: https://www.dropbox.com/s/v9lqzk8ht2de5x5/2.sql?dl=0 i wasn't able to reduce size of the file - if you remove 10+ values from beginning or end of list it works Test script: --------------- <?php $dbh = new PDO('pgsql:host=pgdev.spot2d.com;dbname=ddc_scj', 'login_here', 'pass_here'); $sql = file_get_contents("2.sql"); $dbh->query($sql); ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=76012&edit=1

« previous php.bugs (#236888) next »