php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #49614 PDOStatement::execute assumes string values in array
Submitted: 2009-09-21 19:15 UTC Modified: 2009-11-13 22:13 UTC
From: sjoerd-php at linuxonly dot nl Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
46 + 3 = ?
Subscribe to this entry?

 
 [2009-09-21 19:15 UTC] sjoerd-php at linuxonly dot nl
Description:
------------
The PDOStatement->execute() method takes an array with parameters. This array is assumed to contain string values, but this is not documented.


The values in the array are bound to the statement with PDO_PARAM_STR (according to pdo_stmt.c:470). This should be clarified in the documentation. The documentation already mentions that PDO_PARAM_STR is the default in bindParam(), but it should me mentioned again in the documentation of execute().

This causes confusion when people try to insert other things, especialy booleans:
Bug #44597: Postgres driver does not prepare booleans correctly
Bug #49255: PDO fails to insert boolean FALSE to MySQL in prepared statement


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-11-13 22:13 UTC] svn@php.net
Automatic comment from SVN on behalf of vrana
Revision: http://svn.php.net/viewvc/?view=revision&revision=290713
Log: Treat with strings (bug #49614)
 [2009-11-13 22:13 UTC] vrana@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 13:01:29 2024 UTC