ID: 47009
Updated by: [email protected]
Reported By: andrew at ajohnstone dot com
-Status: Open
+Status: Feedback
Bug Type: PDO related
Operating System: fedora
PHP Version: 5.2.8
New Comment:
I can't reproduce it using sqlite.
<?php
$x = new pdo('sqlite::memory');
$x->query('create table if not exists foo (x int)');
$x->query('insert into foo values (1)');
$x->query('insert into foo values (2)');
$y = $x->prepare('select x from foo
where
-- x = ?
x = ?');
var_dump($y->execute(array(2)));
var_dump($y->fetch());
var_dump($y->errorInfo());
bool(true)
array(2) {
["x"]=>
string(1) "2"
[0]=>
string(1) "2"
}
array(1) {
[0]=>
string(5) "00000"
}
Previous Comments:
------------------------------------------------------------------------
[2009-01-05 15:34:08] andrew at ajohnstone dot com
Description:
------------
databaseException: SQLSTATE[HY093]: Invalid parameter number: number of
bound variables does not match number of tokens
Can't handle commented out lines with bound params
Reproduce code:
---------------
SELECT
*
FROM
mapping_outlets mo
JOIN media_outlets USING(mapping_outlets_id)
WHERE
-- mo.mapping_outlets_id = ?
mo.media_outlets_id = ?
GROUP BY ml.name
ORDER BY NULL
LIMIT 500
Expected result:
----------------
Ignore the commented outline.
Actual result:
--------------
databaseException: SQLSTATE[HY093]: Invalid parameter number: number of
bound variables does not match number of tokens
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=47009&edit=1