Per the documentation (
http://php.net/manual/en/pdostatement.debugdumpparams.php),
PDOStatement::debugDumpParams should be emitting the bind parameter value.
Currently however, it does not. Accordingly, attached is a patch for 5.2
(which also applies cleanly to 5.3), which emits the bind parameter value.
While there are quite a few different ways to print and/or get a printable
version of the zval without having to convert the parameter to a string
in-place, I felt that zend_make_printable_zval was the most appropriate.
Feel free to correct me though ;-)
Also, the first example in the documentation is incorrect, as bindValue can
take at most three arguments.
In the example:
$sth->bindValue(':colour', $colour, PDO::PARAM_STR, 12);
should be:
$sth->bindValue(':colour', $colour, PDO::PARAM_STR);
--
Jonah H. Harris, VP of Database Administration
myYearbook.com
hi,
Can you open a bug and attach the patch to it please?
Thanks for your work,
On Tue, Jul 20, 2010 at 10:30 PM, Jonah H. Harris
jonah.harris@gmail.com wrote:
Per the documentation
(http://php.net/manual/en/pdostatement.debugdumpparams.php),
PDOStatement::debugDumpParams should be emitting the bind parameter value.
Currently however, it does not. Accordingly, attached is a patch for 5.2
(which also applies cleanly to 5.3), which emits the bind parameter value.While there are quite a few different ways to print and/or get a printable
version of the zval without having to convert the parameter to a string
in-place, I felt that zend_make_printable_zval was the most appropriate.
Feel free to correct me though ;-)Also, the first example in the documentation is incorrect, as bindValue can
take at most three arguments.In the example:
$sth->bindValue(':colour', $colour, PDO::PARAM_STR, 12);
should be:
$sth->bindValue(':colour', $colour, PDO::PARAM_STR);
--
Jonah H. Harris, VP of Database Administration
myYearbook.com--
--
Pierre
@pierrejoye | http://blog.thepimp.net | http://www.libgd.org
Hi,
hi,
Can you open a bug and attach the patch to it please?
and please add the bug in "unified diff" format (diff -u) which makes it
simpler to read.
Thanks!
johannes
Thanks for your work,
On Tue, Jul 20, 2010 at 10:30 PM, Jonah H. Harris
jonah.harris@gmail.com wrote:Per the documentation
(http://php.net/manual/en/pdostatement.debugdumpparams.php),
PDOStatement::debugDumpParams should be emitting the bind parameter value.
Currently however, it does not. Accordingly, attached is a patch for 5.2
(which also applies cleanly to 5.3), which emits the bind parameter value.While there are quite a few different ways to print and/or get a printable
version of the zval without having to convert the parameter to a string
in-place, I felt that zend_make_printable_zval was the most appropriate.
Feel free to correct me though ;-)Also, the first example in the documentation is incorrect, as bindValue can
take at most three arguments.In the example:
$sth->bindValue(':colour', $colour, PDO::PARAM_STR, 12);
should be:
$sth->bindValue(':colour', $colour, PDO::PARAM_STR);
--
Jonah H. Harris, VP of Database Administration
myYearbook.com--
--
Pierre@pierrejoye | http://blog.thepimp.net | http://www.libgd.org
2010/7/20 Johannes Schlüter johannes@php.net
Can you open a bug and attach the patch to it please?
and please add the bug in "unified diff" format (diff -u) which makes it
simpler to read.
Sorry about that. I've updated the diff and submitted it as:
http://bugs.php.net/bug.php?id=52384
--
Jonah H. Harris
Blog: http://www.oracle-internals.com/